Skip to content

Commit 81a2528

Browse files
Add automated release pipeline with cross-platform builds
Implements comprehensive release automation using GitHub Actions and GoReleaser to streamline the distribution process and provide cross-platform binaries: • Add GitHub Actions workflow for automated releases triggered by version tags • Configure GoReleaser for cross-platform builds (Linux/macOS on amd64/arm64) • Set up Homebrew tap integration for easy package installation • Enable draft releases with automatic changelog generation • Inject version metadata (version, commit, date) into binaries during build • Create archives with documentation and checksums for distribution Co-authored-by: construct-agent <agent@construct.sh>
1 parent cb11433 commit 81a2528

2 files changed

Lines changed: 121 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release version (e.g., v1.0.0)'
11+
required: true
12+
type: string
13+
14+
env:
15+
GO_VERSION: '1.24.1'
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- name: Setup Golang
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: "1.24"
29+
- name: Run GoReleaser
30+
uses: goreleaser/goreleaser-action@v6
31+
with:
32+
distribution: goreleaser
33+
version: "~> v2"
34+
args: release --clean
35+
env:
36+
HOMEBREW_TAP_GH_TOKEN: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
37+

.goreleaser.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go work sync
6+
7+
builds:
8+
- id: construct
9+
main: ./frontend/cli
10+
binary: construct
11+
env:
12+
- CGO_ENABLED=0
13+
goos:
14+
- linux
15+
- darwin
16+
goarch:
17+
- amd64
18+
- arm64
19+
ldflags:
20+
- -s -w
21+
- -X github.com/furisto/construct/frontend/cli/cmd.version={{.Version}}
22+
- -X github.com/furisto/construct/frontend/cli/cmd.commit={{.Commit}}
23+
- -X github.com/furisto/construct/frontend/cli/cmd.date={{.Date}}
24+
25+
archives:
26+
- id: construct
27+
builds:
28+
- construct
29+
name_template: "construct_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
30+
files:
31+
- README.md
32+
- LICENSE*
33+
- CHANGELOG.md
34+
35+
checksum:
36+
name_template: "construct_{{ .Version }}_checksums.txt"
37+
38+
changelog:
39+
sort: asc
40+
use: github
41+
filters:
42+
exclude:
43+
- "^docs:"
44+
- "^test:"
45+
- "^chore:"
46+
47+
release:
48+
draft: true
49+
replace_existing_draft: true
50+
target_commitish: "{{ .Commit }}"
51+
header: |
52+
## What's Changed
53+
54+
This release includes the following changes:
55+
56+
brews:
57+
- name: construct
58+
repository:
59+
owner: "{{ .Env.GITHUB_OWNER | default \"furisto\" }}"
60+
name: homebrew-tap
61+
branch: main
62+
token: "{{ .Env.HOMEBREW_TAP_GH_TOKEN }}"
63+
commit_author:
64+
name: Thomas Schubart
65+
email: 24721048+Furisto@users.noreply.github.com
66+
homepage: https://github.com/furisto/construct
67+
description: "Your AI-powered development assistant"
68+
license: Apache-2.0
69+
install: |
70+
bin.install "construct"
71+
test: |
72+
system "#{bin}/construct", "version"
73+
74+
env:
75+
- GITHUB_TOKEN
76+
- GITHUB_OWNER
77+
78+
git:
79+
ignore_tags:
80+
- "{{ .Env.SKIP_VALIDATE | default \"false\" }}"
81+
82+
# Uncomment if you want to skip builds for missing git tags during development
83+
# snapshot:
84+
# skip_publish: true

0 commit comments

Comments
 (0)