Repository navigation
Release #1
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: Release | |
| # Publishes a release: verifies both editions, builds the binaries, and creates | |
| # the GitHub release with them attached. | |
| # | |
| # Two ways in. Push a v* tag, or run it by hand with a version -- the manual | |
| # path is the one this repository uses, because pushing a tag from the agent | |
| # session is refused with a 403 (the session's grant covers branches, not tag | |
| # refs). On that path `gh release create` makes the tag itself, with the | |
| # repository's own token, at the commit the run started from. | |
| # | |
| # Nothing gets released past a red suite. | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to publish, e.g. v1.1" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| # A release that fails its own test suite is worse than no release. | |
| verify: | |
| runs-on: ubuntu-latest | |
| env: | |
| SDL_VIDEODRIVER: dummy | |
| SDL_AUDIODRIVER: dummy | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Calculator edition | |
| run: | | |
| python3 tools/lint_globals.py src/nova*.py | |
| python3 tools/fiximports.py --check | |
| python3 tools/build.py | |
| git diff --exit-code -- dist/ | |
| python3 tests/run_all.py | |
| - name: PC edition | |
| run: | | |
| pip install pygame-ce numpy | |
| python3 pc/tests/run_all.py | |
| build: | |
| needs: verify | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| asset: NOVA-windows.exe | |
| built: pc/dist/NOVA.exe | |
| - os: ubuntu-latest | |
| asset: NOVA-linux | |
| built: pc/dist/NOVA | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install | |
| run: pip install pygame-ce numpy pyinstaller | |
| - name: Draw the icon | |
| working-directory: pc | |
| run: python tools/make_icon.py | |
| - name: Build | |
| working-directory: pc | |
| run: pyinstaller --noconfirm --clean nova.spec | |
| - name: Name it for the platform | |
| shell: bash | |
| run: mv "${{ matrix.built }}" "${{ matrix.asset }}" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset }} | |
| path: ${{ matrix.asset }} | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| - name: Bundle the calculator edition | |
| run: | | |
| mkdir -p nova-numworks | |
| cp dist/*.py nova-numworks/ | |
| cp docs/INSTALL.md nova-numworks/ | |
| zip -r nova-numworks.zip nova-numworks | |
| - name: Publish | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ github.event.inputs.version || github.ref_name }} | |
| run: | | |
| # On a manual run there is no tag yet, and `gh release create` makes | |
| # one at the commit this ran on. That is the path this repository | |
| # actually uses: pushing a tag from the agent session is refused with | |
| # a 403 -- the session's grant covers branches, not tag refs -- so the | |
| # repository creates its own tag with its own token. | |
| gh release create "$VERSION" \ | |
| --target "$GITHUB_SHA" \ | |
| --title "NOVA $VERSION" \ | |
| --notes-file .github/RELEASE_NOTES.md \ | |
| NOVA-windows.exe NOVA-linux nova-numworks.zip |