π₯οΈ Builds #3555
Workflow file for this run
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: π₯οΈ Builds | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}|${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: {} | |
| jobs: | |
| static-checks-builds: | |
| name: π Code style, file formatting, and docs | |
| runs-on: ubuntu-latest | |
| if: github.run_attempt > 1 || github.event_name == 'workflow_dispatch' || !vars.DISABLE_BUILDS | |
| outputs: | |
| changed-files: '"${{ steps.changed-files.outputs.clangd_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators. | |
| sources-changed: ${{ steps.changed-files.outputs.sources_any_changed }} | |
| godot-executable-url: ${{ steps.godot-env.outputs.godot-linux-url }} | |
| godot-templates-url: ${{ steps.godot-env.outputs.godot-template-url }} | |
| godot-api-version: ${{ steps.godot-env.outputs.godot-api-version }} | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 # Treeless clone. Slightly less performant than a shallow clone, but makes finding diffs instantaneous. | |
| filter: tree:0 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
| persist-credentials: false | |
| - name: Setup Godot variables | |
| id: godot-env | |
| uses: ./.github/actions/godot-env | |
| - name: Install APT dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3 | |
| with: | |
| packages: libxml2-utils | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| safe_output: false # Output passed to environment variable to avoid command injection. | |
| separator: '" "' # To account for paths with spaces, ensure our items are split by quotes internally. | |
| skip_initial_fetch: true | |
| files_yaml_from_source_file: .github/changed-files.yml | |
| - name: Style checks via prek | |
| uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6 | |
| env: | |
| CHANGED_FILES: '"${{ steps.changed-files.outputs.pre-commit_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators | |
| with: | |
| extra-args: --files ${{ env.CHANGED_FILES }} | |
| - name: Class reference schema checks | |
| run: xmllint --noout --schema extension/doc_tools/class.xsd extension/doc_classes/*.xml | |
| build-master: | |
| name: π οΈ Build | |
| needs: static-checks-builds | |
| if: needs.static-checks-builds.outputs.sources-changed == 'true' || github.event_name != 'pull_request' | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/build-matrix.yml | |
| with: | |
| godot-api-version: ${{ needs.static-checks-builds.outputs.godot-api-version }} | |
| godot-debug-checks: | |
| runs-on: ubuntu-latest | |
| needs: [static-checks-builds, build-master] | |
| name: π Perform Godot Debug Checks | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 # Treeless clone. Slightly less performant than a shallow clone, but makes finding diffs instantaneous. | |
| filter: tree:0 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
| persist-credentials: false | |
| - name: Export game | |
| id: export_game | |
| uses: ./.github/actions/openvic-export | |
| with: | |
| godot-executable-url: ${{ needs.static-checks-builds.outputs.godot-executable-url }} | |
| godot-templates-url: ${{ needs.static-checks-builds.outputs.godot-templates-url }} | |
| export-as-pack: true | |
| export-debug: true | |
| relative-export-path: ./game/export | |
| - name: Check for class reference updates | |
| env: | |
| EXPORT_GAME_OUTPUTS_EXECUTABLE_PATH: ${{ steps.export_game.outputs.executable-path }} | |
| run: | | |
| echo "Running --doctool to see if this changes the public API without updating the documentation." | |
| echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n" | |
| cd game | |
| $EXPORT_GAME_OUTPUTS_EXECUTABLE_PATH --doctool --headless ../extension --gdextension-docs 2>&1 > /dev/null || true | |
| cd .. | |
| git diff --color --exit-code -- '*.xml' && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$' | |
| export-master: | |
| runs-on: ubuntu-latest | |
| needs: [static-checks-builds, build-master] | |
| name: π¦ Export | |
| steps: | |
| - name: Shallow clone | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 1 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
| persist-credentials: false | |
| - name: Export game | |
| id: export_game | |
| uses: ./.github/actions/openvic-export | |
| with: | |
| godot-executable-url: ${{ needs.static-checks-builds.outputs.godot-executable-url }} | |
| godot-templates-url: ${{ needs.static-checks-builds.outputs.godot-templates-url }} | |
| archive-output: true | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| retention-days: 30 | |
| compression-level: 9 | |
| if-no-files-found: error | |
| path: | | |
| ${{ steps.export_game.outputs.archive-directory }} | |
| merge-library-files: | |
| name: π Merge Library Files | |
| runs-on: ubuntu-latest | |
| needs: [godot-debug-checks, export-master] | |
| steps: | |
| - name: Merge Artifacts | |
| uses: actions/upload-artifact/merge@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| delete-merged: true | |
| name: ${{ github.event.repository.name }}-extension | |
| pattern: ${{ github.event.repository.name }}-*-extension | |
| validate-master: | |
| name: β Validate Success | |
| if: always() | |
| needs: [static-checks-builds, build-master, godot-debug-checks, export-master, merge-library-files] | |
| runs-on: Ubuntu-latest | |
| steps: | |
| - name: Check | |
| uses: re-actors/alls-green@a638d6464689bbb24c325bb3fe9404d63a913030 | |
| with: | |
| allowed-skips: static-checks-builds, build-master, godot-debug-checks, export-master, merge-library-files | |
| jobs: ${{ toJson(needs) }} |