Skip to content

Commit f60ff2d

Browse files
committed
Add release-build workflow
1 parent 15b3131 commit f60ff2d

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- v*
9+
paths-ignore:
10+
- .github/**
11+
- .vscode/**
12+
- .editorconfig
13+
- .gitignore
14+
- README.md
15+
16+
jobs:
17+
release-build:
18+
name: Create Release
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Save yarn cache location to env
26+
run: echo "YARN_CACHE=$(yarn cache dir)" >> $GITHUB_ENV
27+
28+
- name: Cache node_modules
29+
uses: actions/cache@v2
30+
env:
31+
CACHE_NAME: cache-node-modules
32+
with:
33+
path: ${{ env.YARN_CACHE }}
34+
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ hashFiles('**/yarn.lock', '**/package-lock.json') }}
35+
36+
- name: Install dependencies
37+
run: yarn install
38+
39+
- name: Run linter
40+
run: yarn lint
41+
42+
- name: Build
43+
run: yarn build
44+
45+
- name: Run tests
46+
run: yarn test
47+
48+
- name: Create release
49+
uses: Trinovantes/action-automatic-release@master
50+
if: startsWith(github.ref, 'refs/tags/')
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
is_prerelease: false

0 commit comments

Comments
 (0)