Update build.yml
This commit is contained in:
parent
29c06f15e2
commit
b709b733bc
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
@ -7,25 +7,42 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
build: [x86, arm]
|
||||||
|
include:
|
||||||
|
- build: x86
|
||||||
|
rust: stable
|
||||||
|
target: x86_64-unknown-linux-musl
|
||||||
|
bin-name: x86_64-unknown-linux-musl-auth
|
||||||
|
archive-name: x86_64-unknown-linux-musl-rust-auth
|
||||||
|
- build: arm
|
||||||
|
rust: stable
|
||||||
|
target: aarch64-unknown-linux-musl
|
||||||
|
bin-name: aarch64-unknown-linux-musl-auth
|
||||||
|
archive-name: aarch64-unknown-linux-musl-rust-auth
|
||||||
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: actions/setup-rust@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.rust }}
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
|
|
||||||
- name: Build and Upload Binary
|
- name: Build and Upload Binary
|
||||||
run: |
|
run: |
|
||||||
cargo build --release --target x86_64-unknown-linux-musl
|
cargo build --release --target x86_64-unknown-linux-musl
|
||||||
cargo build --release --target aarch64-unknown-linux-musl
|
cargo build --release --target aarch64-unknown-linux-musl
|
||||||
# 生成的二进制文件位于 "target/{target}/release/" 目录下
|
# 生成的二进制文件位于 "target/{target}/release/" 目录下
|
||||||
# 可以将生成的二进制文件移动到 "bin" 目录下,以便后续上传为 artifacts
|
|
||||||
mkdir -p bin
|
- name: Upload archive
|
||||||
mv target/x86_64-unknown-linux-musl/release/auth bin/rust-auth-x86_64
|
uses: actions/upload-artifact@v1
|
||||||
mv target/aarch64-unknown-linux-musl/release/auth bin/rust-auth-aarch64
|
|
||||||
- name: Upload Artifacts
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
with:
|
||||||
name: Binaries
|
name: ${{ matrix.archive-name }}
|
||||||
path: bin/
|
path: target/${{ matrix.target }}/release/${{ matrix.bin-name }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user