-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.62 KB
/
set-release-version.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
name: Set release version
on:
push:
branches:
- master
jobs:
set-release-version:
name: Set release version
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js 12.13.x
uses: actions/setup-node@v1
with:
node-version: '12.13.x'
- name: Cache yarn directory
id: cache-yarn-dir
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.cache-yarn-dir.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Disable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@1.0.4
if: always()
with:
access-token: ${{ secrets.GH_TOKEN }}
enforce_admins: false
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
- name: Enable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@1.0.4
if: always() # Force to always run this step to ensure "include administrators" is always turned back on
with:
access-token: ${{ secrets.GH_TOKEN }}
enforce_admins: true
- name: Sync dev with master branch
if: always()
run: git push origin master:dev --force