Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,13 @@ jobs:
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"

# Fetch the commit so that it exists locally.
- name: Fetch commit
if: ${{ github.event.inputs.dry-run == 'false' }}
run: git fetch origin ${GITHUB_EVENT_INPUTS_SHA}
env:
GITHUB_EVENT_INPUTS_SHA: ${{ github.event.inputs.sha }}

# Associate the commit with the tag.
- name: Create tag
if: ${{ github.event.inputs.dry-run == 'false' }}
run: git tag ${GITHUB_EVENT_INPUTS_TAG} ${GITHUB_EVENT_INPUTS_SHA}
env:
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }}
GITHUB_EVENT_INPUTS_SHA: ${{ github.event.inputs.sha }}
- name: Push tag
if: ${{ github.event.inputs.dry-run == 'false' }}
run: git push origin ${GITHUB_EVENT_INPUTS_TAG}
env:
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }}

# Create a GitHub release.
# Create a GitHub draft release for the target commit.
- name: Create GitHub Release
if: ${{ github.event.inputs.dry-run == 'false' }}
run: just release-create ${GITHUB_EVENT_INPUTS_TAG}
run: just release-create ${GITHUB_EVENT_INPUTS_TAG} ${GITHUB_EVENT_INPUTS_SHA}
env:
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }}
GITHUB_EVENT_INPUTS_SHA: ${{ github.event.inputs.sha }}

# Uploading the relevant artifact to the GitHub release.
- run: just release-run ${GH_TOKEN} ${GITHUB_EVENT_INPUTS_SHA} ${GITHUB_EVENT_INPUTS_TAG}
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ Releases
To cut a release, wait for the "MacOS Python build", "Linux Python build", and
"Windows Python build" GitHub Actions to complete successfully on the target commit.

Then, run the "Release" GitHub Action to create a draft release, populate the release artifacts
(by downloading the artifacts from each workflow, and uploading them to the GitHub Release),
publish the release, and promote the SHA via the `latest-release` branch.
Then, run the "Release" GitHub Action to create a draft release for the target commit,
populate the release artifacts (by downloading the artifacts from each workflow, and uploading
them to the GitHub Release), publish the release, and promote the SHA via the `latest-release`
branch.

The "Release" GitHub Action takes, as input, a tag (assumed to be a date in `YYYYMMDD` format) and
the commit SHA referenced above.
Expand Down
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ release-set-latest-release tag:

git switch main

# Create a GitHub release object, or reuse an existing draft release.
release-create tag:
# Create a GitHub draft release for the target commit, or reuse an existing draft release.
release-create tag commit:
#!/usr/bin/env bash
set -euo pipefail
draft_exists=$(gh release view {{tag}} --json isDraft -t '{{{{.isDraft}}' 2>&1 || true)
Expand All @@ -85,7 +85,7 @@ release-create tag:
exit 1
;;
"release not found")
gh release create {{tag}} --draft --title {{tag}} --notes TBD --verify-tag
gh release create {{tag}} --draft --title {{tag}} --notes TBD --target {{commit}}
;;
*)
echo "error: unexpected gh cli output: $draft_exists"
Expand Down
Loading