tools for exporting godot projects via Github Actions
Diffstat (limited to '.github/actions/export/action.yml')
-rw-r--r--.github/actions/export/action.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/.github/actions/export/action.yml b/.github/actions/export/action.yml
new file mode 100644
index 0000000..4c3bd67
--- /dev/null
+++ b/.github/actions/export/action.yml
@@ -0,0 +1,56 @@
+name: Export
+description: exports
+
+inputs:
+ platform:
+ description: The platform (web, linux, mac, android)
+ required: true
+ extension:
+ description: File extension (x86_64, exe, etc)
+ required: true
+ debug:
+ description: Debug build or no (non empty string = true)
+ required: false
+ default: ""
+ name:
+ description: The name ($name.exe) # defaults to $NAME
+ required: false
+
+runs:
+ using: composite
+ steps:
+ - name: Setup
+ uses: bend-n/godot-actions/.github/actions/setup-godot@main
+
+ - name: Get export name
+ id: n
+ uses: bend-n/godot-actions/.github/actions/get-export-name@main
+ with:
+ platform: ${{ inputs.platform }}
+
+ - name: Build
+ run: |
+ p="${{ inputs.platform }}"
+ echo "::group::${p^} Build"
+ export="--export"
+ [[ ${GODOT_VERSION:0:1} -gt 3 ]] && export="--export-release"
+ [[ -n $debug ]] && export="--export-debug"
+ mkdir -vp build/${{ inputs.platform }}
+ n="$NAME"
+ [[ -z "${{ inputs.name}}" ]] && n="${{ inputs.name }}"
+ godot -v --headless --path "${{ env.PROJECT_PATH }}" "$export" "${{ steps.n.outputs.export-name }}" "./build/${{ inputs.platform }}/$n.${{ inputs.extension }}"
+ echo "::endgroup::"
+
+ if [[ -f .github/post_export ]]; then
+ echo "::group::Run post export script"
+ chmod +x .github/post_export
+ ./.github/post_export ${{ inputs.platform }}
+ echo "::endgroup::"
+ fi
+ shell: bash
+
+ - uses: actions/upload-artifact@v3
+ with:
+ name: ${{ inputs.platform }}
+ path: build/${{ inputs.platform}}
+ if-no-files-found: error