Rank boost #27
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: Build Quatrix | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- "*.*.*" | |
env: | |
CARGO_TERM_COLOR: always | |
ITCH_USERNAME: alumux | |
ITCH_GAME_ID: quatrix | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- name: | |
channel: linux | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- channel: windows | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- channel: mac-intel | |
os: macOS-latest | |
target: x86_64-apple-darwin | |
- channel: mac-silicon | |
os: macOS-latest | |
target: aarch64-apple-darwin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout with LFS | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install Linux Dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libwayland-dev | |
- name: Read Rust Toolchain File | |
uses: SebRollen/toml-action@v1.2.0 | |
id: rust_toolchain | |
with: | |
file: rust-toolchain.toml | |
field: toolchain.channel | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ steps.rust_toolchain.outputs.value }} | |
targets: ${{ matrix.target }} | |
- name: Set Environment On Mac ARM | |
if: matrix.target == 'aarch64-apple-darwin' | |
# https://github.com/bevyengine/bevy_github_ci_template/blob/main/.github/workflows/release.yaml macOS 11 was the first version to support ARM | |
run: | | |
export MACOSX_DEPLOYMENT_TARGET="11" | |
- name: Build Game | |
run: cargo install --locked --root install --path . --target ${{ matrix.target }} | |
- name: Copy In Assets | |
run: cp -r assets install/bin/assets | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: install/bin/ | |
name: ${{ matrix.channel }} | |
retention-days: 1 | |
publish: | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
strategy: | |
matrix: | |
channel: [linux, windows, mac-intel, mac-silicon] | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Get Version from Tag | |
uses: olegtarasov/get-tag@v2.1.2 | |
id: get_version | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.channel }} | |
path: build | |
- name: Publish to Itch.io | |
uses: KikimoraGames/itch-publish@v0.0.3 | |
with: | |
butlerApiKey: ${{ secrets.BUTLER_API_KEY }} | |
gameData: build | |
itchUsername: ${{ env.ITCH_USERNAME }} | |
itchGameId: ${{ env.ITCH_GAME_ID }} | |
buildNumber: ${{ steps.get_version.outputs.tag }} | |
buildChannel: ${{ matrix.channel }} |