重构config获取逻辑 #7
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: App Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
- name: Prepare Build | |
run: | | |
wget http://musl.cc/aarch64-linux-musl-cross.tgz -O ${GITHUB_WORKSPACE}/aarch64-linux-musl-cross.tgz | |
tar xvzf ${GITHUB_WORKSPACE}/aarch64-linux-musl-cross.tgz -C ${GITHUB_WORKSPACE}/ | |
- name: Build | |
run: | | |
export PATH=${GITHUB_WORKSPACE}/aarch64-linux-musl-cross/bin:${PATH} | |
rustup target add x86_64-unknown-linux-musl | |
rustup target add aarch64-unknown-linux-musl | |
cargo build --release --target x86_64-unknown-linux-musl | |
cargo build --release --target aarch64-unknown-linux-musl --config='target.aarch64-unknown-linux-musl.linker="aarch64-linux-musl-ld"' | |
- name: Zip the Build | |
run: | | |
ls target/release | |
tar cvzf system-monitor_musl_amd64.tar.gz -C ./target/x86_64-unknown-linux-musl/release system-monitor | |
tar cvzf system-monitor_musl_arm64.tar.gz -C ./target/aarch64-unknown-linux-musl/release system-monitor | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref }} | |
body: TODO New Release. | |
draft: false | |
prerelease: false | |
files: | | |
system-monitor_musl_amd64.tar.gz | |
system-monitor_musl_arm64.tar.gz |