Build and Release Spectrum Client #63
This file contains hidden or 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: Build and Release Spectrum Client | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version tag to release (e.g. v1.2.3)" | |
| required: true | |
| type: string | |
| jobs: | |
| export_spectrum: | |
| name: Build Spectrum Client | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| fetch-depth: 0 | |
| - name: Export Spectrum | |
| id: export | |
| uses: firebelley/godot-export@v7.0.0 | |
| with: | |
| godot_executable_download_url: https://github.com/not-my-username/godot/releases/download/4.5.2-so_reusraddr/godot.linuxbsd.editor.x86_64.zip | |
| godot_export_templates_download_url: https://github.com/not-my-username/godot/releases/download/4.5.2-so_reusraddr/4.5.2.stable.so_reuseaddr.zip | |
| relative_project_path: ./ | |
| archive_output: false | |
| cache: true | |
| presets_to_export: windows.x86_64, macOS.universal, linux.x86.64 | |
| - name: Append version to exported binaries | |
| run: | | |
| set -e | |
| VERSION="${{ inputs.version }}" | |
| DIR="${{ steps.export.outputs.archive_directory }}" | |
| for platform_dir in "$DIR"/*; do | |
| echo "Processing $platform_dir" | |
| cd "$platform_dir" | |
| # Windows | |
| for exe in *.exe; do | |
| [ -e "$exe" ] || continue | |
| mv "$exe" "${exe%.exe}-${VERSION}.exe" | |
| done | |
| # Linux | |
| for bin in *.x86_64; do | |
| [ -e "$bin" ] || continue | |
| mv "$bin" "${bin%.x86_64}-${VERSION}.x86_64" | |
| done | |
| # macOS | |
| for app in *.app; do | |
| [ -e "$app" ] || continue | |
| mv "$app" "${app%.app}-${VERSION}.app" | |
| done | |
| cd - >/dev/null | |
| done | |
| - name: Create git tag | |
| run: | | |
| git tag ${{ inputs.version }} | |
| git push origin ${{ inputs.version }} | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1.14.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ inputs.version }} | |
| name: ${{ inputs.version }} | |
| generateReleaseNotes: true | |
| artifacts: ${{ steps.export.outputs.archive_directory }}/* | |