File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,38 @@ jobs:
109109 echo "Isolated install smoke test passed."
110110
111111 release-gate :
112+ if : startsWith(github.ref, 'refs/tags/v')
112113 needs : [test-and-build, s3-integration, isolated-install-smoke]
113114 runs-on : ubuntu-latest
115+ permissions :
116+ id-token : write # OIDC -> PyPI trusted publishing (no API token)
117+ contents : read
118+
114119 steps :
115- - run : echo "All release gates passed."
120+ - name : Check out repository
121+ uses : actions/checkout@v4
122+
123+ - name : Set up Python
124+ uses : actions/setup-python@v5
125+ with :
126+ python-version : " 3.12"
127+
128+ - name : Set up uv
129+ uses : astral-sh/setup-uv@v4
130+
131+ - name : Verify tag matches package version
132+ run : |
133+ set -euo pipefail
134+ TAG_VERSION="${GITHUB_REF_NAME#v}"
135+ PACKAGE_VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)"
136+ if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
137+ echo "Tag ${GITHUB_REF_NAME} does not match pyproject version ${PACKAGE_VERSION}" >&2
138+ exit 1
139+ fi
140+ echo "Releasing dataref ${PACKAGE_VERSION}"
141+
142+ - name : Build package
143+ run : uv build
144+
145+ - name : Publish to PyPI
146+ run : uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/pypi/dataref/json
You can’t perform that action at this time.
0 commit comments