Prepare Python v0.3.0 #4
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: Release | |
| env: | |
| OPENSTATSPEC_SPECIFICATION_DIR: ${{ github.workspace }}/openstatspec-specification | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| release_ref: | |
| description: "Existing release tag to rebuild and publish idempotently" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: refs/tags/${{ inputs.release_ref || github.ref_name }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.13" | |
| - name: Verify release tag exists and targets this package version | |
| env: | |
| RELEASE_TAG: ${{ inputs.release_ref || github.ref_name }} | |
| run: | | |
| set -eu | |
| git fetch --force --no-tags origin "refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}" | |
| python .github/verify_release_ref.py | |
| - run: python -m pip install --upgrade pip build | |
| - name: Verify required SPSS engine is publicly installable | |
| run: >- | |
| python -m pip download --only-binary=:all: --no-deps | |
| --dest /tmp/openstatspec-engine-release | |
| openstatspec-pyspssio==0.5.1.post2 | |
| - name: Build clean release distributions | |
| run: python -m build | |
| - name: Checkout normative specification fixtures | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: OpenStatSpec/specification | |
| ref: 79339ec3d8f8aa81789b7e85f6b8afa6f1374e50 | |
| path: openstatspec-specification | |
| - name: Checkout required SPSS engine | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: TonisOrmisson/pyspssio | |
| ref: e069adf33c70bcd9e8e6ee495106479463a84fa2 | |
| path: openstatspec-pyspssio | |
| - run: python -m pip install ./openstatspec-pyspssio | |
| - run: python -m pip install -e ".[dev]" | |
| - run: python -m pytest -m "not services" | |
| - run: python -m venv /tmp/openstatspec-release-smoke | |
| - run: /tmp/openstatspec-release-smoke/bin/python -m pip install ./openstatspec-pyspssio | |
| - run: /tmp/openstatspec-release-smoke/bin/python -m pip install dist/*.whl | |
| - run: /tmp/openstatspec-release-smoke/bin/openstatspec capabilities | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/openstatspec | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true |