-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (60 loc) · 2.02 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
59
60
61
62
63
64
65
66
67
68
69
70
name: RC build
# Controls when the action will run. Triggers the workflow on push
# events but only for the rc branch
on:
push:
branches:
- rc
# Publishes beta builds with the dist tag of "rc"
jobs:
# This workflow contains a single job called "publish"
publish:
name: Release candidate build publish
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.THEMES_OPS_SLACK_WEBHOOK_URL }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repo
uses: actions/checkout@v3
# Sets up Node
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://npm.pkg.github.com"
# Caches NPM files
- name: Cache NPM files
uses: actions/cache@v3
id: cache
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Clean install (CI) dependencies if lockfile (above) changed
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Prerelease (tests and lint)
- name: Iterate version rc
run: |
git config --local user.email "[email protected]"
git config --local user.name "$GITHUB_ACTOR"
npm version prerelease --preid=rc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish
- run: npm publish --tag rc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Push tag
- run: git push origin rc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check failure status and post in themes ops channel
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
if: failure()