Skip to content

build

build #37

Workflow file for this run

name: build
on:
workflow_dispatch:
inputs:
version:
description: Build version
required: True
jobs:
build-ubuntu:
strategy:
matrix:
include:
- os: ubuntu-20.04
version: 20
feature: speech_dispatcher_0_9
- os: ubuntu-22.04
version: 22
feature: speech_dispatcher_0_11
- os: ubuntu-24.04
version: 24
feature: speech_dispatcher_0_11
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: apt update
run: sudo apt-get update
- name: install
run: sudo apt install wget clang libspeechd-dev pkg-config libssl-dev alsa librust-alsa-sys-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: cargo build
run: cargo build --release --features ${{ matrix.feature }}
- name: Create release directory
run: mkdir -p cacophony/data
- name: Copy executable
run: cp target/release/cacophony cacophony/cacophony
- name: Copy data/
run: cp -R data cacophony
- name: Download butler
run: wget -O butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
- name: Unzip butler
run: unzip butler.zip
- run: chmod +x butler
- name: butler login
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler login
- name: butler push
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler push cacophony subalterngames/cacophony:ubuntu${{ matrix.version }} --userversion=${{ inputs.version }}
build-macos:
strategy:
matrix:
include:
- os: macos-12
version: 12
- os: macos-13
version: 13
- os: macos-14
version: 14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install cargo bundle
run: cargo install cargo-bundle
- name: cargo build
run: cargo bundle --release
- name: Download butler
run: wget -O butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
- name: Unzip butler
run: unzip butler.zip
- run: chmod +x butler
- name: butler login
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler login
- name: butler push
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler push target/release/bundle/osx/Cacophony.app subalterngames/cacophony:macos${{ matrix.version }} --userversion=${{ inputs.version }}
build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: cargo build
run: cargo build --release
- name: Download butler
run: Invoke-WebRequest -Uri https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default -OutFile butler.zip
shell: powershell
- name: Unzip butler
run: Expand-Archive -Path butler.zip -DestinationPath .
shell: powershell
- name: butler login
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler.exe login
- name: Create release directory
run: New-Item -Path cacophony -ItemType directory
shell: powershell
- name: Copy cacophony.exe
run: Copy-Item target/release/cacophony.exe cacophony/cacophony.exe
shell: powershell
- name: Copy data/
run: Copy-Item -Recurse data cacophony
shell: powershell
- name: butler push
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler.exe push cacophony subalterngames/cacophony:windows --userversion=${{ inputs.version }}