-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.9 KB
/
Copy pathrust.yml
File metadata and controls
60 lines (50 loc) · 1.9 KB
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
name: Build and Release Rust Bins
on:
push:
tags:
- "v*" # Triggers on tags like v1.0.0
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain for ${{ matrix.target }}
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Install cross-compilation dependencies (Linux ARM)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Configure cross linker for aarch64
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --release --verbose
- name: Package binary
run: |
mkdir -p release-artifacts
cp target/${{ matrix.target }}/release/proxyplz release-artifacts/proxyplz-${{ matrix.target }}
tar -czf release-artifacts/proxyplz-${{ matrix.target }}.tar.gz -C release-artifacts proxyplz-${{ matrix.target }}
- name: Create or Update GitHub Release and Upload Asset
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
asset_path: release-artifacts/proxyplz-${{ matrix.target }}.tar.gz
asset_name: proxyplz-${{ matrix.target }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}