49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Build and Upload Binary
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
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:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
profile: minimal
|
|
override: true
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
- name: Build and Upload Binary
|
|
run: |
|
|
cargo build --release --target x86_64-unknown-linux-musl
|
|
cargo build --release --target aarch64-unknown-linux-musl
|
|
# 生成的二进制文件位于 "target/{target}/release/" 目录下
|
|
|
|
- name: Upload archive
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: ${{ matrix.archive-name }}
|
|
path: target/${{ matrix.target }}/release/${{ matrix.bin-name }}
|