feat: add durable PostgreSQL orchestration workflows #2
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: Publish to PyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: pypi-publish | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Test and build distributions | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Check out tagged source | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install all component, test, and build dependencies | |
| run: python -m pip install --editable '.[dev]' | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| package_version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')" | |
| if [[ "${GITHUB_REF_NAME}" != "v${package_version}" ]]; then | |
| echo "Tag ${GITHUB_REF_NAME} does not match package version ${package_version}" >&2 | |
| exit 1 | |
| fi | |
| - name: Run quality gates | |
| run: | | |
| ruff check . | |
| ruff format --check . | |
| python -m pytest -q | |
| python -m pip check | |
| - name: Build wheel and source distribution | |
| run: python -m build | |
| - name: Check distribution metadata and README rendering | |
| run: python -m twine check dist/* | |
| - name: Smoke-test wheel and transitive component installation | |
| shell: bash | |
| run: | | |
| python -m venv "${RUNNER_TEMP}/pg-play-wheel-smoke" | |
| "${RUNNER_TEMP}/pg-play-wheel-smoke/bin/python" -m pip install dist/*.whl | |
| "${RUNNER_TEMP}/pg-play-wheel-smoke/bin/python" -m pip check | |
| "${RUNNER_TEMP}/pg-play-wheel-smoke/bin/pg-play" capabilities | |
| for command in pg-configurator pg-diag pg-perf-bench pg-stand pg-workload; do | |
| "${RUNNER_TEMP}/pg-play-wheel-smoke/bin/${command}" --version | |
| done | |
| - name: Upload distributions for publishing | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| publish: | |
| name: Publish distributions to PyPI | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/pg-play | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| name: python-distributions | |
| path: dist/ | |
| - name: Publish distributions with trusted publishing | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 |