Skip to content

Commit ea9f7da

Browse files
authored
Add release (#4)
1 parent af617ad commit ea9f7da

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release Binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ${{ matrix.os }}
10+
env:
11+
BIN_NAME: secretik
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
name: linux-x86_64
18+
19+
- os: ubuntu-latest
20+
target: aarch64-unknown-linux-gnu
21+
name: linux-aarch64
22+
23+
- os: macos-latest
24+
target: x86_64-apple-darwin
25+
name: macos-x86_64
26+
27+
- os: macos-latest
28+
target: aarch64-apple-darwin
29+
name: macos-aarch64
30+
31+
name: Build ${{ matrix.name }}
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install Rust toolchain
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
targets: ${{ matrix.target }}
40+
41+
- name: Install dependencies (Linux ARM only)
42+
if: matrix.target == 'aarch64-unknown-linux-gnu'
43+
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
44+
45+
- name: Build release
46+
run: |
47+
cargo build --release --target=${{ matrix.target }}
48+
mkdir -p dist
49+
cp target/${{ matrix.target }}/release/${{ env.BIN_NAME }} dist/${{ env.BIN_NAME }}-${{ matrix.name }}
50+
51+
- name: Upload release asset
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
files: dist/${{ env.BIN_NAME }}-${{ matrix.name }}
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)