Skip to content

release

release #41

Workflow file for this run

name: release
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
release:
name: "Release"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: gfold
asset_name: gfold-linux-gnu-x86-64
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
artifact_name: gfold
asset_name: gfold-linux-musl-x86-64
target: x86_64-unknown-linux-musl
- os: windows-latest
artifact_name: gfold.exe
asset_name: gfold-windows-x86-64.exe
target: x86_64-pc-windows-msvc
- os: macos-latest
artifact_name: gfold
asset_name: gfold-darwin-aarch64
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt update && sudo apt install -y musl-tools
- run: cargo build --release --locked --target ${{ matrix.target }}
- shell: bash
run: |
if [ $(echo ${{ github.ref }} | grep "rc") ]; then
echo "PRERELEASE=true" >> $GITHUB_ENV
echo "PRERELEASE=true"
else
echo "PRERELEASE=false" >> $GITHUB_ENV
echo "PRERELEASE=false"
fi
echo $PRERELEASE
mv target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.asset_name }}
prerelease: ${{ env.PRERELEASE }}
body: "Please refer to **[CHANGELOG.md](https://github.com/nickgerace/gfold/blob/main/CHANGELOG.md)** for information on this release."