name: Build Canary Version
on:
push:
tags:
- v*
jobs:
release:
name: Release on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform: [macos-x86_64, linux_glibc-x86_64, linux_musl-x86_64, linux_musl-i686, windows-i686, windows-x86_64]
include:
- platform: macos-x86_64
target: x86_64-apple-darwin
os: macos-latest
bin: petpet
- platform: linux_glibc-x86_64
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
bin: petpet
- platform: linux_musl-x86_64
target: x86_64-unknown-linux-musl
os: ubuntu-latest
bin: petpet
- platform: linux_musl-i686
target: i686-unknown-linux-musl
os: ubuntu-latest
bin: petpet
- platform: windows-i686
target: i686-pc-windows-msvc
os: windows-latest
bin: petpet.exe
- platform: windows-x86_64
target: x86_64-pc-windows-msvc
os: windows-latest
bin: petpet.exe
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
toolchain: stable
- name: Build executable
run: cargo build --release --target ${{ matrix.target }} -F more_format
- name: Prepare assets
shell: bash
run: |
mv target/${{ matrix.target }}/release/${{ matrix.bin }} .
tar -cvf ${{ matrix.target }}.tar orig LICENSE.txt ${{ matrix.bin }} img/speed_to_cpu-time.png
- name: Declare some variables id: vars
shell: bash
run: |
petpet_ver=$(cargo metadata --format-version 1 --no-deps | sed -r 's/.*"version":"([^"]*)".*/\1/')
echo "petpet_ver=${petpet_ver}" >> $GITHUB_OUTPUT
- name: Pre-Release
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.target }}.tar
tag_name: v${{ steps.vars.outputs.petpet_ver }}
prerelease: false