-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 1.79 KB
/
main.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
name: Rust Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
targets: ['x86_64-unknown-linux-musl', 'x86_64-unknown-linux-gnu']
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build
run: |
rustup target add ${{ matrix.targets }}
cargo build --release --target=${{ matrix.targets }}
cp target/${{ matrix.targets }}/release/otk otk-${{ matrix.targets }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@d30f1144e884b1fe579845ed7a339c640dff522e
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: otk-${{ matrix.targets }}
path: otk-${{ matrix.targets }}
release:
name: publish
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Install Nodejs
uses: actions/setup-node@v3
with:
node-version: 16
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
- uses: actions/download-artifact@v1
with:
name: otk-x86_64-unknown-linux-musl
path: ./dist
- uses: actions/download-artifact@v1
with:
name: otk-x86_64-unknown-linux-gnu
path: ./dist
- run: ls -al ./dist
- name: Publish Release
uses: ./.github/actions/github-release
with:
files: "dist/*"
name: latest
token: ${{ secrets.GITHUB_TOKEN }}