udpate #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
name: Release - ${{ matrix.platform.release_for }} | |
permissions: write-all | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
matrix: | |
platform: | |
- release_for: Linux-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
bin: angel | |
name: angel-linux-amd64 | |
- release_for: Linux-aarch64 | |
os: ubuntu-latest-arm64 # 改这里,直接使用 ARM64 的运行环境 | |
target: aarch64-unknown-linux-gnu | |
bin: angel | |
name: angel-linux-arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies for Linux-aarch64 | |
if: matrix.platform.target == 'aarch64-unknown-linux-gnu' && runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.platform.target }} | |
- name: Build | |
run: | | |
cargo install sqlx-cli --no-default-features --features sqlite | |
export DATABASE_URL=sqlite:./db.sqlite | |
sqlx database create | |
sqlx migrate run | |
cargo build --release --bin angel --target ${{ matrix.platform.target }} | |
- name: Prepare assets | |
shell: bash | |
run: | | |
cd target/${{ matrix.platform.target }}/release | |
mv ${{ matrix.platform.bin }} ${{ matrix.platform.name }} | |
- name: Upload binaries to release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
target/${{ matrix.platform.target }}/release/${{ matrix.platform.name }} | |
draft: false | |
prerelease: false |