-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (48 loc) · 1.44 KB
/
release.yml
File metadata and controls
48 lines (48 loc) · 1.44 KB
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
name: Release
on:
push:
branches:
- main
- alpha
- beta
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(./.yarn/cache)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Ensure linted
run: yarn run ensure-linted
- name: Rust Build & Test
run: cargo build --verbose && cargo test --verbose
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
if [ -z "$GITHUB_TOKEN" ]; then
echo 'Unexpected empty GITHUB_TOKEN' >&2
exit 1
fi
if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
echo 'Please set secrets.CARGO_REGISTRY_TOKEN' >&2
exit 1
fi
yarn run semantic-release