update dependencies #12
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: on-push | |
on: [push] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Install non-go dependencies | |
run: sudo apt-get update && sudo apt-get install libgl1-mesa-dev xorg-dev libasound2-dev zip | |
- name: Install butler # used to upload files to itch.io | |
run: | | |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default | |
unzip butler.zip | |
chmod +x butler | |
./butler -V | |
- name: Build linux executable | |
run: go build -o game . | |
- name: Build windows executable | |
env: | |
GOOS: windows | |
GOARCH: amd64 | |
run: go build -o game.exe . | |
- name: Build wasm archive for itch.io | |
run: ./build_wasm.sh | |
- name: Release on github | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
game.exe | |
game | |
game_wasm.zip | |
name: ${{ github.ref_name }} | |
- name: Release on itch.io | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
run: | | |
./butler push dist remieven/ysgo-sample-cubeandsphere:web --userversion ${{ github.ref_name }} --if-changed | |
./butler push game remieven/ysgo-sample-cubeandsphere:linux --userversion ${{ github.ref_name }} --if-changed | |
./butler push game.exe remieven/ysgo-sample-cubeandsphere:windows --userversion ${{ github.ref_name }} --if-changed |