-
Notifications
You must be signed in to change notification settings - Fork 17
70 lines (60 loc) · 1.74 KB
/
build_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
name: Build
on:
release:
types: [published]
jobs:
binaries:
name: ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
include:
- os: ubuntu-latest
release_name: linux_x86_64
- os: macos-latest
release_name: macos_x86_64
- os: windows-latest
release_name: windows_x86_64
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup NodeJS toolchain
uses: actions/setup-node@v2
with:
node-version: "14"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Build
run: node build.js
- name: Compress
uses: vimtor/action-zip@v1
with:
files: release/
dest: ${{ matrix.release_name }}.zip
- name: Get tag name
id: tag_name
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
shell: bash
if: startsWith(github.ref, 'refs/tags/v')
- name: Publish
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.release_name }}.zip
tag: ${{ github.ref }}
asset_name: oasis-$tag-${{ matrix.release_name }}.zip
if: startsWith(github.ref, 'refs/tags/v')