chore: merge release-v0.0.14 into main #14
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 CI | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
################################################# | |
## Cross platform binary build for release page # | |
################################################# | |
cross_platform_build: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
output_name: linux_x86_64.tar.gz | |
- target: aarch64-unknown-linux-gnu | |
output_name: linux_aarch64.tar.gz | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Install stable rust, and associated tools | |
- name: install rust | |
uses: dtolnay/rust-toolchain@stable | |
# Install cross-rs | |
- name: install cross | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
# Build binary | |
- name: build | |
run: cross build --target ${{ matrix.target }} --release | |
# Compress the binary | |
- name: compress linux | |
run: | | |
tar -C "target/${{ matrix.target }}/release" -czf "./staticpi_${{ matrix.output_name }}" staticpi | |
# Upload output for release page | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: ${{ matrix.target }} | |
path: staticpi_${{ matrix.output_name }} | |
retention-days: 1 | |
################### | |
## Create release # | |
################### | |
create_release: | |
needs: [cross_platform_build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup | Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Update Release | |
uses: ncipollo/release-action@v1 | |
with: | |
makeLatest: true | |
name: ${{ github.ref_name }} | |
tag: ${{ github.ref }} | |
bodyFile: ".github/release-body.md" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: | | |
**/staticpi_*.tar.gz |