forked from WPMedia/arc-themes-blocks
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (46 loc) · 1.47 KB
/
canary-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
name: Canary block
on:
push:
branches:
- canary
# Publishes Canary builds with the dist tag of "canary" and
# with a version of 0.0.0 with a short git SHA appended to
# the end.
jobs:
publish:
name: Canary 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"
scope: '@wpmedia'
- 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')"
- run: npx lerna publish 0.0.0-canary.$(git rev-parse --short HEAD).${{ steps.get-datetime.outputs.date }} --no-git-tag-version --no-push --dist-tag canary --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check failure status
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
if: failure()