tools for exporting godot projects via Github Actions
fix itch.io pushing on callable workflow
| -rw-r--r-- | .github/actions/itch-push/action.yml | 4 | ||||
| -rw-r--r-- | .github/workflows/callable-export.yml | 18 | ||||
| -rw-r--r-- | README.md | 5 |
3 files changed, 21 insertions, 6 deletions
diff --git a/.github/actions/itch-push/action.yml b/.github/actions/itch-push/action.yml index 91c1be2..f8ca0fd 100644 --- a/.github/actions/itch-push/action.yml +++ b/.github/actions/itch-push/action.yml @@ -21,14 +21,13 @@ runs: - name: Push run: | - [[ -z $ITCH_PATH ]] && ITCH_PATH=bendn/${{ env.NAME }} function push() { channel=$1 [[ ! -d $channel ]] && exit 0 echo "::group::Push $channel" [[ $channel == mac ]] && echo -e '#!/bin/bash\ncd "$(dirname "$0")";\nxattr -cr "$(pwd)/${{ env.NAME }}.app";\nopen -n -a "$(pwd)/${{ env.NAME }}.app"' >./mac/run.sh chmod +x **; - butler push "$channel" "$ITCH_PATH:$channel" + butler push "$channel" "${{ inputs.itch-path }}:$channel" echo "::endgroup::" } push "web"; push "linux"; push "windows"; @@ -36,5 +35,4 @@ runs: [[ -d android ]] && rm android/*.idsig && push "android" env: BUTLER_API_KEY: ${{ inputs.api-key }} - ITCH_PATH: ${{ inputs.itch-path }} shell: bash diff --git a/.github/workflows/callable-export.yml b/.github/workflows/callable-export.yml index 8c5366e..3dfb9e8 100644 --- a/.github/workflows/callable-export.yml +++ b/.github/workflows/callable-export.yml @@ -32,6 +32,11 @@ on: default: "true" required: false type: string # shut + itch-path: + description: "the itch.io path to export to, eg: bendn/chess" + default: "${{ github.repository_owner }}/${{ github.event.repository.name }}" + required: false + type: string secrets: android-keystore-base64: description: For signing the apk, will be filled with andrid debug keystore if left blank @@ -106,11 +111,22 @@ jobs: push-itch: needs: [linux, android, windows, mac, web] - if: always() && inputs.butler-api-key # run even if the previous jobs were skipped + if: always() # run even if the previous jobs were skipped name: Push to itch.io runs-on: ubuntu-20.04 steps: + - name: check + id: secret + run: | + function output() { echo "::set-output name=secret::$1"; } + if [[ -n "${{ secrets.butler-api-key }}" ]]; + then output "true"; + else output "false"; + fi + - name: Push + if: steps.secret.outputs.secret == 'true' uses: bend-n/godot-actions/.github/actions/itch-push@main with: api-key: ${{ secrets.butler-api-key }} + itch-path: ${{ inputs.itch-path }} @@ -31,7 +31,7 @@ build-windows: <summary>Full example</summary> > **Note** -> This is a copy of [godot-template/.github/workflows/export.yml](https://github.com/bend-n/godot-template/blob/67c92540c4f8724d1d9994d546d4717c7d807e8f/.github/workflows/export.yml) +> This is a copy of [godot-template/.github/workflows/export.yml](https://github.com/bend-n/godot-template/blob/d009ad9ba50e5d84360d8de9a1b7beceae3e3cd0/.github/workflows/export.yml) ```yaml name: "export" # name of the workflow @@ -59,10 +59,11 @@ jobs: # the things to do platforms: "windows linux web android mac" # space seperated list of platforms to build project-root-path: "." # the directory that project.godot is in github-pages: "true" # to deploy to github pages or not (anything besides 'true' == false) + itch-path: "${{ github.repository_owner }}/${{ github.event.repository.name }}" # required for itch.io deployment. secrets: # secrets + butler-api-key: ${{ secrets.BUTLER_CREDENTIALS }} # required for itch.io deployment android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} # for signing the apk, not required android-keystore-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} # ditto - butler-api-key: ${{ secrets.BUTLER_CREDENTIALS }} # required for itch.io deployment ``` </details> |