1+ name : Publish Go Package
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+ branches :
8+ - main
9+ - publish-workflow
10+ workflow_dispatch :
11+ inputs :
12+ version :
13+ description : ' Package version to publish (e.g., 1.0.0)'
14+ required : true
15+ type : string
16+
17+ jobs :
18+ publish :
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Go
26+ uses : actions/setup-go@v4
27+ with :
28+ go-version : ' 1.23'
29+
30+ - name : Cache Go modules
31+ uses : actions/cache@v3
32+ with :
33+ path : |
34+ ~/go/pkg/mod
35+ ~/go/pkg/cache
36+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+ restore-keys : |
38+ ${{ runner.os }}-go-
39+
40+ - name : Test Go package
41+ run : |
42+ cd replayer-adapter-go
43+ go mod download
44+ go test ./... -v
45+ continue-on-error : true
46+
47+ - name : Build Go package
48+ run : |
49+ cd replayer-adapter-go
50+ go build -v ./...
51+
52+ - name : Create GitHub Release
53+ if : startsWith(github.ref, 'refs/tags/v')
54+ uses : actions/create-release@v1
55+ env :
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ with :
58+ tag_name : ${{ github.ref }}
59+ release_name : Release ${{ github.ref }}
60+ body : |
61+ ## Changes in this release
62+
63+ This release includes updates to the Temporal Workflow Debugger Go replayer adapter.
64+
65+ ### Package: temporal-replayer-adapter-go
66+
67+ - Version: ${{ github.ref_name }}
68+ - Built from commit: ${{ github.sha }}
69+ - Go version: 1.23
70+
71+ ### Installation
72+
73+ ```bash
74+ go get github.com/phuongdnguyen/temporal-workflow-debugger/replayer-adapter-go@${{ github.ref_name }}
75+ ```
76+ draft : false
77+ prerelease : false
78+
79+ - name : Manual release creation
80+ if : github.event_name == 'workflow_dispatch'
81+ run : |
82+ echo "Manual release triggered for version: ${{ github.event.inputs.version }}"
83+ echo "To create a release, push a tag with the version:"
84+ echo "git tag v${{ github.event.inputs.version }}"
85+ echo "git push origin v${{ github.event.inputs.version }}"
0 commit comments