-
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (79 loc) · 2.29 KB
/
release.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# inspired by
# @see https://github.com/Jungwoo-An/react-editor-js/blob/1375dea6a3704d16bb234eaa58db6e4104807a11/.github/workflows/publish.yml
name: release
on:
workflow_dispatch:
jobs:
install:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: node_modules
key: natterstefan-scripts-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: chmod -R +x ./node_modules/.bin
validate:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set @natterstefan-bot as committer
run: |
git config user.name "natterstefan Bot"
git config user.email "natterstefan-bot@users.noreply.github.com"
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: node_modules
key: natterstefan-scripts-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: yarn lint
- run: yarn test
build:
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: node_modules
key: natterstefan-scripts-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: yarn build
- uses: actions/upload-artifact@v1
with:
name: build
path: build
publish:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: node_modules
key: natterstefan-scripts-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v2
with:
name: build
# - name: Display structure of downloaded files
# run: ls -R
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}