fix release, separate macos build into arm/x64 #17
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 | |
on: | |
push: | |
tags: "v[0-9]+.[0-9]+.[0-9]+" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
GAME_NAME: "game-template" | |
MSRV: "1.71" # minimum supported rust version | |
CACHE_SUFFIX: c # cache busting | |
jobs: | |
build: | |
name: Build ${{ matrix.name }} | |
permissions: write-all | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Windows | |
- name: Windows x86_64 | |
os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
bin_suffix: "-win-x86_64.exe" | |
# macOS Intel | |
- name: macOS x86_64 | |
os: macos-latest | |
target: x86_64-apple-darwin | |
bin_suffix: "-macos-x86_64" | |
# macOS Apple Silicon | |
- name: macOS arm64 | |
os: macos-latest | |
target: aarch64-apple-darwin | |
bin_suffix: "-macos-arm64" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
run: | | |
rustup toolchain install ${{ env.MSRV }} --no-self-update --profile=minimal --target ${{ matrix.target }} | |
rustup override set ${{ env.MSRV }} | |
cargo -V | |
- name: Compile | |
shell: bash | |
run: | | |
cargo build --target ${{ matrix.target }} --release --no-default-features | |
- name: Create artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.GAME_NAME }}-${{ matrix.os }} | |
path: target/${{ matrix.target }}/release/${{ env.GAME_NAME }}${{ matrix.bin_suffix }} | |
release: | |
name: Create release | |
needs: build | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
path: ~/release | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Create release | |
shell: bash | |
run: | | |
cd ~/release | |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} $(ls) |