-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (67 loc) · 3.64 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
72
73
74
75
76
77
78
79
80
81
82
83
name: Publish
on:
push:
branches: [ "stable" ]
env:
CARGO_TERM_COLOR: always
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ningenMe/[email protected]
- run: sudo apt-get install -qq --yes --force-yes musl-tools mold gcc-mingw-w64 gcc-multilib gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 clang-13 llvm-13 lld-13 llvm-dev gcc-mingw-w64-i686-win32 gcc-mingw-w64-x86-64-win32
- run: cargo install cargo-xwin --locked
- run: echo "XWIN_ARCH=x86,x86_64,aarch64,aarch" >> "$GITHUB_ENV"
- name: Create release dir
run: rm -fr target/github-release && mkdir -p target/github-release
- name: Build for x86_64-unknown-linux-gnu
run: rustup target add x86_64-unknown-linux-gnu &&
cargo build --verbose --release --target x86_64-unknown-linux-gnu &&
cp target/x86_64-unknown-linux-gnu/release/discord-backup-util
target/github-release/discord-backup-util.x86_64-unknown-linux-gnu
- name: Build for x86_64-unknown-linux-gnu
run: rustup target add x86_64-unknown-linux-musl &&
cargo build --verbose --release --target x86_64-unknown-linux-musl &&
cp target/x86_64-unknown-linux-musl/release/discord-backup-util
target/github-release/discord-backup-util.x86_64-unknown-linux-musl
- name: Build for i586-unknown-linux-gnu
run: rustup target add i586-unknown-linux-gnu &&
cargo build --verbose --release --target i586-unknown-linux-gnu --no-default-features --features minreq &&
cp target/i586-unknown-linux-gnu/release/discord-backup-util
target/github-release/discord-backup-util.i586-unknown-linux-gnu
- name: Build for i686-unknown-linux-gnu
run: rustup target add i686-unknown-linux-gnu &&
cargo build --verbose --release --target i686-unknown-linux-gnu &&
cp target/i686-unknown-linux-gnu/release/discord-backup-util
target/github-release/discord-backup-util.i686-unknown-linux-gnu
- name: Build for x86_64-pc-windows-gnu
run: rustup target add x86_64-pc-windows-gnu &&
cargo build --verbose --release --target x86_64-pc-windows-gnu &&
cp target/x86_64-pc-windows-gnu/release/discord-backup-util.exe
target/github-release/discord-backup-util.x86_64-pc-windows-gnu.exe
- name: Build for x86_64-pc-windows-msvc
run: rustup target add x86_64-pc-windows-msvc &&
cargo xwin build --verbose --release --target x86_64-pc-windows-msvc &&
cp target/x86_64-pc-windows-msvc/release/discord-backup-util.exe
target/github-release/discord-backup-util.x86_64-pc-windows-msvc.exe
- name: Build for i686-pc-windows-gnu
run: rustup target add i686-pc-windows-gnu &&
cargo build --verbose --release --target i686-pc-windows-gnu &&
cp target/i686-pc-windows-gnu/release/discord-backup-util.exe
target/github-release/discord-backup-util.i686-pc-windows-gnu.exe
- name: Build for i686-pc-windows-msvc
run: rustup target add i686-pc-windows-msvc &&
cargo xwin build --verbose --release --target i686-pc-windows-msvc &&
cp target/i686-pc-windows-msvc/release/discord-backup-util.exe
target/github-release/discord-backup-util.i686-pc-windows-msvc.exe
- uses: 5GameMaker/crate-version@dfc9d2a7ac4d6250f460c5270266e697edba6e7f
id: crate-version
- uses: ncipollo/release-action@v1
with:
tag: v${{ steps.crate-version.outputs.version }}
artifacts: "target/github-release/*"
commit: stable
generateReleaseNotes: true