3.1.7: Straight outta Half Moon Bay #170
Workflow file for this run
This file contains 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 and publish the prefect-client | |
on: | |
release: | |
types: [released, prereleased] | |
jobs: | |
verify-prefect-client-build: | |
uses: ./.github/workflows/prefect-client.yaml | |
with: | |
upload-artifacts: true | |
artifact-name: "prefect-client-pypi-dists" | |
secrets: inherit | |
publish-prefect-client-pypi-dists: | |
name: Publish to PyPI | |
environment: ${{ github.event.release.prerelease && 'pre-release' || 'prod' }} | |
needs: [verify-prefect-client-build] | |
runs-on: ubuntu-latest | |
permissions: | |
# this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Validate Prerelease Tag | |
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }} | |
run: | | |
TAG_NAME=${{ github.ref }} | |
if [[ ! "$TAG_NAME" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9]+$ ]]; then | |
echo "Error: Tag $TAG_NAME does not match prerelease version pattern." | |
exit 1 | |
fi | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: "prefect-client-pypi-dists" | |
path: "./dist" | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |