Skip to content

Commit cd2e27b

Browse files
authored
Release v0.2.0 (#39)
* fix: resolve broken action SHAs in release workflow Replace non-resolvable commit SHA references with semver tags: - actions/setup-go: SHA → v6 - actions/upload-artifact: SHA → v4 * feat: add workflow_dispatch to release workflow for testing Allow manual triggering with tag input and dry-run mode to test the release pipeline without publishing artifacts.
1 parent 4b11fa8 commit cd2e27b

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to release (e.g. v0.2.0)'
11+
required: true
12+
type: string
13+
dry_run:
14+
description: 'Skip publishing (dry run)'
15+
required: false
16+
type: boolean
17+
default: true
718

819
jobs:
920
release:
@@ -18,7 +29,7 @@ jobs:
1829
with:
1930
fetch-depth: 0
2031
- name: Set up Go
21-
uses: actions/setup-go@41dfa10bef8ca8f7c4c7cec63b269ccb8a9156b9 # v6
32+
uses: actions/setup-go@v6
2233
with:
2334
go-version-file: go.mod
2435
cache-dependency-path: go.sum
@@ -30,23 +41,27 @@ jobs:
3041
registry: ghcr.io
3142
username: ${{ github.actor }}
3243
password: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Resolve tag
45+
id: resolve_tag
46+
run: echo "tag=${{ github.event.inputs.tag || github.ref_name }}" >> "$GITHUB_OUTPUT"
3347
- name: Verify changie release notes exist
3448
run: |
35-
if [ ! -f "changes/${{ github.ref_name }}.md" ]; then
36-
echo "::error::Changie fragment changes/${{ github.ref_name }}.md not found."
37-
echo "::error::Run 'changie batch ${{ github.ref_name }}' and 'changie merge' before pushing the tag."
49+
if [ ! -f "changes/${{ steps.resolve_tag.outputs.tag }}.md" ]; then
50+
echo "::error::Changie fragment changes/${{ steps.resolve_tag.outputs.tag }}.md not found."
51+
echo "::error::Run 'changie batch ${{ steps.resolve_tag.outputs.tag }}' and 'changie merge' before pushing the tag."
3852
exit 1
3953
fi
4054
- name: Execute GoReleaser
4155
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # goreleaser-action v7
4256
with:
4357
distribution: goreleaser
4458
version: "~> v2"
45-
args: release --clean --release-notes changes/${{ github.ref_name }}.md
59+
args: release --clean --release-notes changes/${{ steps.resolve_tag.outputs.tag }}.md ${{ github.event.inputs.dry_run == 'true' && '--skip-publish' || '' }}
4660
env:
4761
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4862
- name: Upload assets
49-
uses: actions/upload-artifact@5d5df5e032fcb57d3c9d9901e9b8f8b2b7d8051a # v7
63+
if: ${{ github.event.inputs.dry_run != 'true' }}
64+
uses: actions/upload-artifact@v4
5065
with:
5166
name: devcloud
5267
path: dist/*

0 commit comments

Comments
 (0)