Skip to content

Commit 7f1ceec

Browse files
committed
ci: publish a GitHub Release instead of a bare tag
python-deequ historically ships GitHub Releases (v1.1.0..v1.6.0), not bare tags. Replace the 'git tag + push' step with 'gh release create v${VERSION} --target ${RELEASE_SHA} --generate-notes', which creates the tag AND the Release page in one call, pinned to the published commit, after the PyPI upload. Idempotent (skips if the release already exists). Note: this change was intended for #281 but landed on that branch after it had already merged, so it never reached master — hence this follow-up PR.
1 parent cea2156 commit 7f1ceec

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ jobs:
132132

133133
tag-and-bump:
134134
# Runs ONLY after a successful real publish (needs: publish gates on
135-
# success). Creates the release tag as a record of what is now on PyPI (tag
136-
# after publish, never before), then opens a PR recording the version.
135+
# success). Creates the GitHub release (and its tag) as a record of what is
136+
# now on PyPI — after publish, never before — then opens a PR recording the
137+
# version.
137138
needs: publish
138139
if: ${{ !inputs.dry_run }}
139140
runs-on: ubuntu-latest
@@ -160,18 +161,24 @@ jobs:
160161
- name: Install Poetry
161162
run: pip install poetry==1.7.1
162163

163-
- name: Tag the published release
164-
# Tag the exact published commit, now that PyPI has the artifact.
165-
# Idempotent: skip if the tag already exists remotely.
164+
- name: Create GitHub release
165+
# Create a GitHub release (which also creates the v${VERSION} tag) on the
166+
# exact published commit, now that PyPI has the artifact — matching the
167+
# repo's historical convention of publishing Releases, not bare tags.
168+
# Idempotent: skip if the release already exists. Note --target is
169+
# honored only when the tag is new; on an already-existing tag GitHub
170+
# ignores it (releases must always use a fresh version, per above).
166171
run: |
167-
git config user.name "github-actions[bot]"
168-
git config user.email "github-actions[bot]@users.noreply.github.com"
169-
if git ls-remote --exit-code --tags origin "v${VERSION}" >/dev/null 2>&1; then
170-
echo "Tag v${VERSION} already exists — skipping."
172+
if gh release view "v${VERSION}" >/dev/null 2>&1; then
173+
echo "Release v${VERSION} already exists — skipping."
171174
else
172-
git tag -a "v${VERSION}" "${RELEASE_SHA}" -m "Release ${VERSION}"
173-
git push origin "v${VERSION}"
175+
gh release create "v${VERSION}" \
176+
--target "${RELEASE_SHA}" \
177+
--title "v${VERSION}" \
178+
--generate-notes
174179
fi
180+
env:
181+
GH_TOKEN: ${{ github.token }}
175182

176183
- name: Record release version in master and open PR
177184
# Records the just-released version in the repo (sets pyproject +

0 commit comments

Comments
 (0)