Skip to content

v0.1.4

v0.1.4 #6

Workflow file for this run

name: Publish to itch.io
on:
release:
types: [released]
env:
CARGO_TERM_COLOR: always
jobs:
release-build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [windows, web]
include:
- platform: windows
target: x86_64-pc-windows-gnu
executable_name: "${{ vars.KEBAB_CASE_GAME_NAME }}.exe"
- platform: web
target: wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- name: Install MinGW toolchain
if: matrix.target == 'x86_64-pc-windows-gnu'
run: sudo apt update; sudo apt install -y gcc-mingw-w64-x86-64
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install tools for WASM build
if: matrix.platform == 'web'
run: cargo install trunk --locked --version 0.19.3
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ vars.CACHE_BUILD_VERSION }}-cargo-${{ runner.os }}
key: ${{ matrix.platform }}
- name: Install alsa and udev
run: sudo apt update; sudo apt install --no-install-recommends libasound2-dev libudev-dev
- name: Build release
if: matrix.platform == 'web'
run: trunk build --release --public-url="./"
- name: Build release
if: matrix.platform != 'web'
run: cargo build --release --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
if: matrix.platform == 'web'
with:
name: ${{ matrix.platform }}
path: ./dist/*
- uses: actions/upload-artifact@v4
if: matrix.platform != 'web'
with:
name: ${{ matrix.platform }}
# We don't need to publish the `assets` folder alongside the binary as we are using bevy_embedded_assets
path: |
./target/${{ matrix.target }}/release/${{ matrix.executable_name }}
publish:
runs-on: ubuntu-latest
needs:
- release-build
strategy:
matrix:
platform: [windows, web]
steps:
- name: Download and check butler
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- run: mkdir release
- name: Download ${{ matrix.platform }} release artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.platform }}
path: ./release
- name: Publish game with butler
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
./butler push ./release/ ${{ vars.ITCH_IO_USERNAME }}/${{ vars.KEBAB_CASE_GAME_NAME }}:${{ matrix.platform }} --userversion ${{ github.event.release.tag_name }}