forked from WPMedia/arc-themes-blocks
-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (54 loc) · 1.77 KB
/
rc-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Release candidate blocks publish to rc tag
on:
push:
branches:
- rc
# Publishes rc builds with the dist tag of "rc" and
# with a version of 0.0.0 with a short git SHA appended to
# the end.
jobs:
publish:
name: rc block publish
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Cache NPM files
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "12"
registry-url: "https://npm.pkg.github.com"
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
- name: Run tests
run: npm run test
- name: Get current datetime for re-running publish if necessary
id: get-datetime
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "12"
registry-url: 'https://registry.npmjs.org'
scope: '@mentor-medier'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to rc tag with a short git SHA as the version
run: npx lerna publish 0.0.0-rc.$(git rev-parse --short HEAD).${{ steps.get-datetime.outputs.date }} --no-git-tag-version --no-push --dist-tag rc --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check rc failure status
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
if: failure()