tools for exporting godot projects via Github Actions
Diffstat (limited to '.github/workflows/callable-export.yml')
| -rw-r--r-- | .github/workflows/callable-export.yml | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/.github/workflows/callable-export.yml b/.github/workflows/callable-export.yml new file mode 100644 index 0000000..19406cc --- /dev/null +++ b/.github/workflows/callable-export.yml @@ -0,0 +1,156 @@ +name: "export" +on: + workflow_call: + inputs: + godot-version: + description: the godot version (deprecated, this is now parsed out of the image input) + required: false + type: string + # deprecationMessage: This is parsed out of the image input. + # deprecation message doesnt work, done manually. + image: + description: the container to use + default: ghcr.io/bend-n/godot-2d:3.5 + required: true + type: string + export-name: + description: the name of the exec. ($export-name.exe) + default: ${{ github.event.repository.name }} + required: false + type: string + platforms: + description: space seperated platform list + default: "windows linux web android mac" + required: false + type: string + project-root-path: + description: the directory that project.godot is in (relative to repo root) + default: "." + required: false + type: string + github-pages: + description: to deploy to github pages or not to deploy to github pages + 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 + required: false + android-keystore-password: + description: For signing the apk, will be filled with andrid debug keystore if left blank + required: false + butler-api-key: + description: For deploying to itch.io + required: false + +env: + PROJECT_PATH: ${{ inputs.project-root-path }} + NAME: ${{ inputs.export-name }} + +jobs: + deprecation-warn: + runs-on: ubuntu-latest + if: ${{ inputs.godot-version }} + name: Warn for deprecation + steps: + - name: version deprecation warn + if: ${{ inputs.godot-version }} + run: echo "::warning title=input.godot-version deprecated::Version now parsed out of input.image" + + linux: + runs-on: ubuntu-latest + if: contains(inputs.platforms, 'linux') + container: + image: ${{ inputs.image }} + name: Linux + steps: + - name: Get ver + run: echo "GODOT_VERSION=$(echo ${{ inputs.image }} | cut -d':' -f2-)" >> $GITHUB_ENV + + - name: Build + uses: bend-n/godot-actions/.github/actions/export-linux@main + + windows: + runs-on: ubuntu-latest + if: contains(inputs.platforms, 'windows') + container: + image: ${{ inputs.image }} + name: Windows + steps: + - name: Get ver + run: echo "GODOT_VERSION=$(echo ${{ inputs.image }} | cut -d':' -f2-)" >> $GITHUB_ENV + + - name: Build + uses: bend-n/godot-actions/.github/actions/export-windows@main + + mac: + runs-on: ubuntu-latest + if: contains(inputs.platforms, 'mac') + container: + image: ${{ inputs.image }} + name: macOS + steps: + - name: Get ver + run: echo "GODOT_VERSION=$(echo ${{ inputs.image }} | cut -d':' -f2-)" >> $GITHUB_ENV + + - name: Build + uses: bend-n/godot-actions/.github/actions/export-mac@main + + web: + runs-on: ubuntu-latest + if: contains(inputs.platforms, 'web') + container: + image: ${{ inputs.image }} + name: HTML5 + steps: + - name: Get ver + run: echo "GODOT_VERSION=$(echo ${{ inputs.image }} | cut -d':' -f2-)" >> $GITHUB_ENV + + - name: Build + uses: bend-n/godot-actions/.github/actions/export-web@main + with: + github-pages: ${{ inputs.github-pages }} + + android: + runs-on: ubuntu-latest + if: contains(inputs.platforms, 'android') + container: + image: ${{ inputs.image }} + name: Android + steps: + - name: Get ver + run: echo "GODOT_VERSION=$(echo ${{ inputs.image }} | cut -d':' -f2-)" >> $GITHUB_ENV + + - name: Build + uses: bend-n/godot-actions/.github/actions/export-android@main + with: + android-keystore-base64: ${{ secrets.android-keystore-base64 }} + android-password: ${{ secrets.android-keystore-password }} + + push-itch: + needs: [linux, android, windows, mac, web] + 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 "secret=$1" >> "$GITHUB_OUTPUT"; } + 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 }} |