Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 3ba3678

Browse files
committed
Update release workflow to build and upload Rust binaries
1 parent a95a617 commit 3ba3678

File tree

1 file changed

+43
-29
lines changed

1 file changed

+43
-29
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
1-
name: Release
1+
name: Build and Upload Rust Binaries
22

33
on:
4-
release:
5-
types: [created]
6-
4+
release:
5+
types: [created]
6+
workflow_dispatch:
77

88
jobs:
9-
release:
10-
name: release ${{ matrix.target }}
11-
runs-on: ubuntu-latest
12-
permissions:
13-
contents: write
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
include:
18-
- target: x86_64-pc-windows-gnu
19-
archive: zip
20-
- target: x86_64-unknown-linux-musl
21-
archive: tar.gz zip
22-
- target: x86_64-apple-darwin
23-
archive: zip
24-
steps:
25-
- uses: actions/checkout@master
26-
- name: Compile and release
27-
uses: rust-build/rust-build.action@v1.4.4
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
MINIFY: true
31-
with:
32-
RUSTTARGET: ${{ matrix.target }}
33-
ARCHIVE_TYPES: ${{ matrix.archive }}
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
permissions:
12+
contents: write
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
target: x86_64-unknown-linux-gnu
18+
- os: macos-latest
19+
target: x86_64-apple-darwin
20+
- os: windows-latest
21+
target: x86_64-pc-windows-msvc
22+
- os: ubuntu-latest
23+
target: aarch64-unknown-linux-gnu
24+
- os: macos-latest
25+
target: aarch64-apple-darwin
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Install Rust
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: stable
35+
override: true
36+
target: ${{ matrix.target }}
37+
38+
- name: Build
39+
run: cargo build --release --target ${{ matrix.target }}
40+
41+
- name: Upload binaries to release
42+
uses: svenstaro/upload-release-action@v2
43+
with:
44+
repo_token: ${{ secrets.GITHUB_TOKEN }}
45+
file: target/${{ matrix.target }}/release/*
46+
tag: ${{ github.ref }}
47+
file_glob: true

0 commit comments

Comments
 (0)