Skip to content

Commit 41b8ca3

Browse files
authored
Merge pull request #8788 from chrisburr/conda-forge-release-v9r0
[v9] chore: update the conda-forge feedstock as part of the release process
2 parents b9f6c35 + 7c73b6d commit 41b8ca3

2 files changed

Lines changed: 42 additions & 11 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
id-token: write
2222
attestations: write
2323
contents: write
24+
outputs:
25+
conda-forge-version: ${{ steps.check-tag.outputs.conda-forge-version }}
2426
defaults:
2527
run:
2628
shell: bash -l {0}
@@ -111,6 +113,9 @@ jobs:
111113
# Output to later steps
112114
echo "create-release=true" >> $GITHUB_OUTPUT
113115
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
116+
# Expose the version for the conda-forge feedstock, skipping pre-releases
117+
CONDA_FORGE_VERSION=$(python -c $'from packaging.version import Version; v = Version('"'$NEW_VERSION'"$')\nprint("" if v.is_prerelease else v)')
118+
echo "conda-forge-version=$CONDA_FORGE_VERSION" >> $GITHUB_OUTPUT
114119
fi
115120
fi
116121
fi
@@ -189,3 +194,20 @@ jobs:
189194
uses: mxschmitt/action-tmate@v3
190195
with:
191196
limit-access-to-actor: true
197+
198+
update-conda-forge:
199+
name: conda-forge feedstock update
200+
runs-on: "ubuntu-latest"
201+
needs: deploy-pypi
202+
if: needs.deploy-pypi.outputs.conda-forge-version != ''
203+
environment: conda-forge
204+
steps:
205+
- name: Update the dirac-grid feedstock
206+
uses: conda-forge/release@45b05fddc6addd06d5f982ebe0a88378ec44de92 # v2026.9.15
207+
with:
208+
feedstock: dirac-grid-feedstock
209+
feedstock-branch: v9.0.x
210+
version: ${{ needs.deploy-pypi.outputs.conda-forge-version }}
211+
github-token: ${{ secrets.CONDA_FORGE_PAT }}
212+
github-token-for-fork: ${{ secrets.CONDA_FORGE_FORK_PAT }}
213+
automerge: true

docs/diracdoctools/scripts/dirac-docs-get-release-notes.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -504,26 +504,35 @@ def getGithubLatestTagDate(self, sinceTag):
504504
"""
505505
log = LOGGER.getChild("getGithubLatestTagDate")
506506

507-
# Get all tags
508-
tags = req2Json(url=self._github("tags"), queryParameters={"per_page": 100})
509-
if isinstance(tags, dict) and "Not Found" in tags.get("message"):
510-
raise RuntimeError(f"Package not found: {str(self)}")
511-
512507
if sinceTag:
513-
for tag in tags:
514-
if tag["name"] == sinceTag:
515-
latestTag = tag
508+
# Look the tag up directly as there are more tags than fit in a single page of
509+
# the "tags" endpoint. This matches any tag starting with sinceTag so the exact
510+
# match still has to be picked out of the results.
511+
refs = req2Json(url=self._github(f"git/matching-refs/tags/{sinceTag}"), queryParameters={"per_page": 100})
512+
for ref in refs:
513+
if ref["ref"] == f"refs/tags/{sinceTag}":
516514
break
517515
else:
518516
raise ValueError(f"Tag {sinceTag} not found")
517+
latestTagName = sinceTag
518+
latestTagCommitSha = ref["object"]["sha"]
519+
if ref["object"]["type"] == "tag":
520+
# Annotated tags have to be dereferenced to find the commit they point at
521+
tagInfo = req2Json(url=self._github(f"git/tags/{latestTagCommitSha}"))
522+
latestTagCommitSha = tagInfo["object"]["sha"]
519523
else:
524+
# Get all tags
525+
tags = req2Json(url=self._github("tags"), queryParameters={"per_page": 100})
526+
if isinstance(tags, dict) and "Not Found" in tags.get("message"):
527+
raise RuntimeError(f"Package not found: {str(self)}")
528+
520529
sortedTags = sorted(tags, key=lambda tag: LooseVersion(tag["name"]), reverse=True)
521-
latestTag = sortedTags[0]
530+
latestTagName = sortedTags[0]["name"]
531+
latestTagCommitSha = sortedTags[0]["commit"]["sha"]
522532

523-
log.info("Found latest tag %s", latestTag["name"])
533+
log.info("Found latest tag %s", latestTagName)
524534

525535
# Use the sha of the commit to finally retrieve the date
526-
latestTagCommitSha = latestTag["commit"]["sha"]
527536
commitInfo = req2Json(url=self._github(f"git/commits/{latestTagCommitSha}"))
528537

529538
startDate = dateutil.parser.isoparse(commitInfo["committer"]["date"])

0 commit comments

Comments
 (0)