Release #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "The version to release (e.g., '20250414')." | |
type: string | |
sha: | |
description: "The full SHA of the commit to be released (e.g., 'd09ff921d92d6da8d8a608eaa850dc8c0f638194')." | |
type: string | |
dry-run: | |
description: "Dry run? Tests the release process without publishing." | |
default: false | |
required: false | |
type: boolean | |
env: | |
FORCE_COLOR: 1 | |
permissions: {} | |
jobs: | |
release: | |
name: Release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
runs-on: depot-ubuntu-24.04-8 | |
permissions: | |
contents: write | |
packages: write | |
# Permissions used for actions/attest-build-provenance | |
id-token: write | |
attestations: write | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
with: | |
submodules: recursive | |
persist-credentials: true # needed for git operations below | |
- uses: extractions/setup-crate@4993624604c307fbca528d28a3c8b60fa5ecc859 # v1.4.0 | |
with: | |
repo: casey/just | |
version: 1.42.4 | |
# Perform a release in dry-run mode. | |
- run: just release-dry-run ${GH_TOKEN} ${GITHUB_EVENT_INPUTS_SHA} ${GITHUB_EVENT_INPUTS_TAG} | |
if: ${{ github.event.inputs.dry-run == 'true' }} | |
env: | |
GITHUB_EVENT_INPUTS_SHA: ${{ github.event.inputs.sha }} | |
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }} | |
- name: Configure Git identity | |
if: ${{ github.event.inputs.dry-run == 'false' }} | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
# 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. | |
- name: Create GitHub Release | |
if: ${{ github.event.inputs.dry-run == 'false' }} | |
run: just release-create ${GITHUB_EVENT_INPUTS_TAG} | |
env: | |
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }} | |
# Uploading the relevant artifact to the GitHub release. | |
- run: just release-run ${GH_TOKEN} ${GITHUB_EVENT_INPUTS_SHA} ${GITHUB_EVENT_INPUTS_TAG} | |
if: ${{ github.event.inputs.dry-run == 'false' }} | |
env: | |
GITHUB_EVENT_INPUTS_SHA: ${{ github.event.inputs.sha }} | |
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }} | |
- name: Generate attestations | |
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 | |
if: ${{ github.event.inputs.dry-run == 'false' }} | |
with: | |
subject-path: | | |
dist/*.tar.gz | |
dist/*.tar.zst |