Skip to content

Commit 068caf0

Browse files
committed
ci: release workflow
1 parent 3052a47 commit 068caf0

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build and Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: 'stable' # Uses latest stable Go version
24+
cache: true # Automatically caches Go modules
25+
26+
- name: Build binary
27+
run: |
28+
go build -v -o hm-linux-amd64
29+
chmod +x hm-linux-amd64
30+
env:
31+
CGO_ENABLED: 0
32+
GOOS: linux
33+
GOARCH: amd64
34+
35+
- name: Create release
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
files: hm-linux-amd64
39+
generate_release_notes: true
40+
draft: false
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)