bugged-racing/.github/workflows/deploy_macos.yml

48 lines
1.8 KiB
YAML
Raw Normal View History

2021-12-02 10:10:12 +00:00
name: "Deploy signed MacOS to Itch.io"
on:
workflow_dispatch:
env:
GODOT_VERSION: 3.4
jobs:
export:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Step taken from https://github.com/robpc/maze-test-game
- name: Build game
env:
PRESET: Mac OSX
BUILD_DIR: build/mac
run: |
wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_osx.universal.zip
unzip Godot_v${GODOT_VERSION}-stable_osx.universal.zip
export XDG_DATA_HOME="$(pwd)/xdg_data_home"
export TEMPLATES_DIR="${XDG_DATA_HOME}/godot/templates/${GODOT_VERSION}.stable/"
mkdir -p ${TEMPLATES_DIR}
wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz
mv templates/* ${TEMPLATES_DIR}
mkdir -p ${BUILD_DIR}
Godot.app/Contents/MacOS/Godot --export "${PRESET}"
2021-12-02 10:10:12 +00:00
- name: Install butler
run: |
# -L follows redirects
# -O specifies output name
curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
2021-12-02 10:10:12 +00:00
unzip butler.zip
# GNU unzip tends to not set the executable bit even though it's set in the .zip
chmod +x butler
# just a sanity check run (and also helpful in case you're sharing CI logs)
./butler -V
- name: Itch.io deploy
env:
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
./butler push ./build/mac $ITCHIO_USERNAME/$ITCHIO_GAME:$EXPORT_DIR_NAME