Skip to content

Commit a853274

Browse files
committed
added release github action
1 parent d9e9fb7 commit a853274

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release Binaries
2+
# This workflow builds and releases binaries for different platforms
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
branches:
9+
- 'release_action'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
include:
18+
- target: aarch64-unknown-linux-gnu
19+
compiler: gcc-aarch64-linux-gnu
20+
linker: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
21+
release_binary: target/aarch64-unknown-linux-gnu/release/rcat
22+
asset_name: rcat_arm64
23+
24+
- target: x86_64-unknown-linux-gnu
25+
compiler: gcc
26+
linker: CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc
27+
release_binary: target/x86_64-unknown-linux-gnu/release/rcat
28+
asset_name: rcat_amd64
29+
30+
- target: x86_64-pc-windows-gnu
31+
compiler: mingw-w64 cmake nasm
32+
linker: CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=/usr/bin/x86_64-w64-mingw32-gcc
33+
release_binary: target/x86_64-pc-windows-gnu/release/rcat.exe
34+
asset_name: rcat.exe
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
40+
- name: Install Rust toolchain
41+
uses: dtolnay/rust-toolchain@stable
42+
with:
43+
toolchain: stable
44+
targets: ${{ matrix.target }}
45+
46+
- name: Install compiler
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y ${{ matrix.compiler }}
50+
51+
- name: Setup the linker as an environment variable
52+
run: echo "${{ matrix.linker }}" >> $GITHUB_ENV
53+
54+
- name: Build
55+
run: cargo build --release --target ${{ matrix.target }}
56+
57+
- name: Upload release binary
58+
uses: svenstaro/upload-release-action@v2
59+
with:
60+
file: ${{ matrix.release_binary }}
61+
asset_name: ${{ matrix.asset_name}}
62+
63+
release-macos:
64+
runs-on: macos-latest
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
- name: Install Rust toolchain
71+
uses: dtolnay/rust-toolchain@stable
72+
73+
- name: Build
74+
run: cargo build --release
75+
76+
- name: Upload release binary
77+
uses: svenstaro/upload-release-action@v2
78+
with:
79+
file: target/release/rcat
80+
asset_name: rcat_macos

0 commit comments

Comments
 (0)