Skip to content

Commit 5b08c3e

Browse files
authored
Added build and release automation (#7)
1 parent e576a83 commit 5b08c3e

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.24.1'
23+
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v6
26+
with:
27+
version: latest
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# goreleaser.yml
2+
project_name: speculator
3+
builds:
4+
- id: speculator
5+
main: ./main.go
6+
binary: speculator
7+
env:
8+
- CGO_ENABLED=0
9+
goos:
10+
- linux
11+
- darwin
12+
goarch:
13+
- amd64
14+
- arm64
15+
ldflags:
16+
- "-s -w"
17+
18+
archives:
19+
- id: tarballs
20+
format: tar.gz
21+
name_template: "speculator-{{ .Os }}-{{ .Arch }}"

0 commit comments

Comments
 (0)