-
-
Notifications
You must be signed in to change notification settings - Fork 11
106 lines (80 loc) · 3.08 KB
/
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release
on:
release:
types: [created]
jobs:
publish-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build amd64
run: cargo build --release
- name: Prepare amd64 binary
run: |
mv target/release/discrakt target/release/discrakt_amd64
chmod +x target/release/discrakt_amd64
- name: Build arm64
run: cargo build --release --target=aarch64-unknown-linux-musl
- name: Prepare arm64 Binary
run: |
mv target/aarch64-unknown-linux-musl/release/discrakt target/release/discrakt_arm64
chmod +x target/release/discrakt_arm64
- name: Upload binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} target/release/discrakt_arm64
gh release upload ${{ github.ref_name }} target/release/discrakt_amd64
publish-win:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build win64
run: cargo build --release
- name: Prepare win64 Binary
run: mv target/release/discrakt.exe target/release/discrakt_win64.exe
- name: Create silent win64 executable
run: sed -i '1i\#\!\[windows_subsystem\ \=\ \"windows\"\]' src/main.rs
- name: Build silent win64 executable
run: cargo build --release
- name: Prepare silent win64 Binary
run: mv target/release/discrakt.exe target/release/discrakt_win64_silent.exe
- name: Upload binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} target/release/discrakt_win64_silent.exe
gh release upload ${{ github.ref_name }} target/release/discrakt_win64.exe
publish-mac:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
- name: Build darwin
run: cargo build --release --target=x86_64-apple-darwin
- name: Prepare darwin binary
run: |
mv target/x86_64-apple-darwin/release/discrakt target/release/discrakt_darwin
chmod +x target/release/discrakt_darwin
- name: Build darwin arm64
run: cargo build --release --target=aarch64-apple-darwin
- name: Prepare darwin arm64 binary
run: |
mv target/aarch64-apple-darwin/release/discrakt target/release/discrakt_darwin_arm64
chmod +x target/release/discrakt_darwin_arm64
- name: Upload binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.ref_name }} target/release/discrakt_darwin_arm64
gh release upload ${{ github.ref_name }} target/release/discrakt_darwin