Skip to content

Use gh release instead of someone's release action #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
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
11 changes: 2 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- run: just release-dry-run ${{ secrets.GITHUB_TOKEN }} ${{ github.event.inputs.sha }} ${{ github.event.inputs.tag }}
if: ${{ github.event.inputs.dry-run == 'true' }}

# Create the release itself.
# Set our identity for git operations (on the latest-release branch).
- name: Configure Git identity
if: ${{ github.event.inputs.dry-run == 'false' }}
run: |
Expand All @@ -66,14 +66,7 @@ jobs:
# Create a GitHub release.
- name: Create GitHub Release
if: ${{ github.event.inputs.dry-run == 'false' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.tag }}
prerelease: true
body: TBD
allowUpdates: true
updateOnlyUnreleased: true
run: just release-create ${{ github.events.input.tag }}

# Uploading the relevant artifact to the GitHub release.
- run: just release-run ${{ secrets.GITHUB_TOKEN }} ${{ github.event.inputs.sha }} ${{ github.event.inputs.tag }}
Expand Down
22 changes: 22 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ release-set-latest-release tag:
echo "No changes to commit."
fi

# Create a GitHub release object, or reuse an existing prerelease.
release-create tag:
#!/usr/bin/env bash
set -euo pipefail
prerelease_exists=$(gh release view {{tag}} --json isPrerelease -t '{{{{.isPrerelease}}' 2>&1 || true)
case "$prerelease_exists" in
true)
echo "note: updating existing prerelease {{tag}}"
;;
false)
echo "error: release {{tag}} already exists"
exit 1
;;
"release not found")
gh release create {{tag}} --prerelease --notes TBD --verify-tag
;;
*)
echo "error: unexpected gh cli output: $prerelease_exists"
exit 1
;;
esac

# Perform the release job. Assumes that the GitHub Release has been created.
release-run token commit tag:
#!/bin/bash
Expand Down
Loading