Add manifest.json as the runtime source of truth #70
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: Build Python Packages | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| release_date: | |
| description: > | |
| Release tag (YYYYMMDD). When set, a single GitHub release with that | |
| tag is created and all per-platform tarballs from every matrix entry | |
| are published as assets. Leave empty for a build-only run that uploads | |
| per-job artifacts but does not publish a release. | |
| required: false | |
| type: string | |
| default: "" | |
| # Cancel in-flight runs when a newer event arrives for the same logical branch. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| name: Read build matrix from manifest | |
| runs-on: ubuntu-latest | |
| outputs: | |
| versions: ${{ steps.read.outputs.versions }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Extract Python versions from manifest.json | |
| id: read | |
| # manifest.json is the single source of truth: it both selects which | |
| # CPython versions are built here and is published as a release asset | |
| # (see publish-release) for serious_python / flet to consume. | |
| run: echo "versions=$(jq -c '[.pythons[].full_version]' manifest.json)" >> "$GITHUB_OUTPUT" | |
| build-matrix: | |
| name: Build Python ${{ matrix.python_version }} | |
| needs: setup | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python_version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| uses: ./.github/workflows/build-python-version.yml | |
| with: | |
| python_version: ${{ matrix.python_version }} | |
| secrets: inherit | |
| publish-release: | |
| name: Publish Release Assets | |
| runs-on: ubuntu-latest | |
| # Date-keyed releases (PBS-style): only publish when an operator explicitly | |
| # triggers via workflow_dispatch with a `release_date` input. Pushes still | |
| # exercise the matrix but leave per-job artifacts for inspection and do | |
| # not touch GitHub releases. | |
| if: github.event_name == 'workflow_dispatch' && inputs.release_date != '' | |
| needs: | |
| - setup | |
| - build-matrix | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: python-* | |
| path: release-artifacts | |
| merge-multiple: true | |
| - name: Add runtime manifest (with release date) to the release | |
| # Publish the same manifest.json that drove this build, with the release | |
| # date injected, so consumers can fetch a consistent version set by date. | |
| run: jq '.release = "${{ inputs.release_date }}"' manifest.json > release-artifacts/manifest.json | |
| - name: Publish all artifacts to release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ inputs.release_date }} | |
| name: ${{ inputs.release_date }} | |
| files: release-artifacts/* | |
| fail_on_unmatched_files: true | |
| generate_release_notes: false | |
| draft: false | |
| prerelease: false |