-
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (69 loc) · 2.28 KB
/
publish.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
name: Rust
on:
push:
tags:
- 'v*'
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
bin/hub release create -m ${GITHUB_REF#refs/tags/} ${GITHUB_REF#refs/tags/}
publish_linux:
name: Publish Linux Artifact
runs-on: ubuntu-latest
needs: create_release
steps:
- uses: actions/checkout@v4
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: x86_64-unknown-linux-gnu
- name: Create Artifact
run: |
cargo build --target x86_64-unknown-linux-gnu --release
mkdir dist
cp target/x86_64-unknown-linux-gnu/release/sub dist/
cd dist
tar czf sub-${GITHUB_REF#refs/tags/}-x86_64-unknown-linux-gnu.tar.gz *
cd ..
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
bin/hub release edit -a "dist/sub-${GITHUB_REF#refs/tags/}-x86_64-unknown-linux-gnu.tar.gz" -m ${GITHUB_REF#refs/tags/} ${GITHUB_REF#refs/tags/}
publish_osx:
name: Publish OSX Artifact
runs-on: macos-latest
needs: create_release
steps:
- uses: actions/checkout@v4
- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: aarch64-apple-darwin
- name: Create Artifact
run: |
cargo build --target aarch64-apple-darwin --release
mkdir dist
cp target/aarch64-apple-darwin/release/sub dist/
cd dist
tar czf sub-${GITHUB_REF#refs/tags/}-aarch64-apple-darwin.tar.gz *
cd ..
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
bin/hub release edit -a "dist/sub-${GITHUB_REF#refs/tags/}-aarch64-apple-darwin.tar.gz" -m ${GITHUB_REF#refs/tags/} ${GITHUB_REF#refs/tags/}