Skip to content

chore: merge release-v0.2.8 into main #20

chore: merge release-v0.2.8 into main

chore: merge release-v0.2.8 into main #20

Workflow file for this run

name: Release CI
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
cross_platform_build:
strategy:
matrix:
platform:
- target: aarch64-unknown-linux-musl
- target: arm-unknown-linux-musleabihf
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
# Set env's
- name: set names
run: |
translate_platform() { case "$1" in aarch64-unknown-linux-musl) echo "aarch64.tar.gz";; arm-unknown-linux-musleabihf) echo "armv6.tar.gz";; *) echo "Error: Unsupported platform $1"; exit 1;; esac; }
target_platform="${{ matrix.platform.target }}"
output_name=$(translate_platform "$target_platform")
echo "TARGET_OUTPUT_NAME=${output_name}" >> $GITHUB_ENV
echo "TARGET_PLATFORM=${target_platform}" >> $GITHUB_ENV
# Build binary
- name: build
run: cross build --target "${TARGET_PLATFORM}" --release
# Compress, rename, and move
- name: compress
run: tar -C "target/${TARGET_PLATFORM}/release" -czf "./leafcast_${TARGET_OUTPUT_NAME}" leafcast
# Upload output for release page
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: ${{ env.TARGET_PLATFORM }}
path: leafcast_${{ env.TARGET_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@v3
- 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: |
**/leafcast_*.tar.gz