Skip to content

Commit dec84fd

Browse files
Merge pull request #12 from threshold-network/ci/auto-release
ENG-469 ci/auto release
2 parents d867599 + 2895913 commit dec84fd

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v6
22+
with:
23+
go-version: "1.22"
24+
cache: true
25+
26+
- name: Run Go generators
27+
run: go generate ./.../gen
28+
29+
- name: Ensure generated code is clean
30+
run: git diff --exit-code
31+
32+
- name: Run Go vet
33+
run: go vet ./...
34+
35+
- name: Build Go
36+
run: go build ./...
37+
38+
- name: Run Go tests
39+
run: go test ./...
40+
41+
- name: Publish GitHub release
42+
uses: softprops/action-gh-release@v2
43+
with:
44+
tag_name: ${{ github.ref_name }}
45+
name: Release ${{ github.ref_name }}
46+
body: Release ${{ github.ref_name }}. See CHANGELOG.md for details.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ go test ./...
2828

2929
== Releases
3030

31-
See link:RELEASE.md[Release guide] for versioning, tagging, and publishing steps.
31+
See link:RELEASE.md[Release guide] for versioning, tagging, and publishing steps. Pushing a `v*` tag on `main` runs the release workflow, which regenerates code, vets, tests, and publishes a GitHub release for that tag.
3232

3333
== Directory structure
3434

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Process for publishing tagged Go module releases for this fork of `keep-common`.
1616
## Tagging & Publishing
1717
1) Tag: `git tag -a vX.Y.Z -m "Release vX.Y.Z"` (or `vX.Y.Z-tlabs.N` for fork-specific releases).
1818
2) Push tag: `git push origin vX.Y.Z[-tlabs.N]`.
19-
3) Create a GitHub release from the tag with the changelog excerpt and a note about the upstream baseline.
19+
3) CI: pushing a `v*` tag triggers the release workflow to regenerate code, run vet/tests, and publish a GitHub release with a placeholder body referencing `CHANGELOG.md`. Edit the GitHub release afterward to paste the changelog excerpt and upstream baseline notes.

0 commit comments

Comments
 (0)