Skip to content

Commit 0d3dcde

Browse files
authored
Merge pull request #15 from co-browser/releaser-action-script
feat: semantic-release with goreleaser integration for all platforms
2 parents 51102da + 24efa7f commit 0d3dcde

File tree

2 files changed

+243
-29
lines changed

2 files changed

+243
-29
lines changed

.github/workflows/release.yaml

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,60 @@
11
---
2-
name: Tag and Release
3-
4-
on:
5-
push:
6-
branches:
7-
- main
8-
9-
permissions:
10-
contents: write
11-
issues: write
12-
pull-requests: write
13-
14-
jobs:
15-
release:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Use Node.js
25-
uses: actions/setup-node@v4
26-
27-
- name: Run semantic-release
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
30-
run: npx semantic-release --branches main --plugins "@semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/github"
2+
name: Tag and Release
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
container:
18+
image: ghcr.io/goreleaser/goreleaser-cross:v1.24.1
19+
steps:
20+
- name: Act Workaround # https://github.com/nektos/act/issues/973
21+
if: ${{ env.ACT }}
22+
run: curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version: '1.24'
32+
- name: Generate templ code
33+
uses: capthiron/templ-generator-action@v1
34+
with:
35+
setup-go: "false"
36+
commit: "false"
37+
38+
- name: Check GoReleaser configuration
39+
run: |
40+
goreleaser check
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 'lts/*'
46+
47+
- name: Install semantic-release
48+
run: |
49+
npm install --global semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github @semantic-release/exec
50+
51+
- name: Configure semantic-release
52+
run: |
53+
# shellcheck disable=SC2016
54+
echo '{"preset":"conventionalcommits","plugins":[["@semantic-release/commit-analyzer"],["@semantic-release/release-notes-generator"],["@semantic-release/github"],["@semantic-release/exec",{"publishCmd":"echo \"${nextRelease.notes}\" > /tmp/release-notes.md && goreleaser release --release-notes /tmp/release-notes.md --clean"}]]}' > .releaserc.json
55+
56+
- name: Run semantic-release
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
59+
run: |
60+
semantic-release

.goreleaser.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
project_name: agent-browser
2+
version: 2
3+
release:
4+
prerelease: auto
5+
env:
6+
- CGO_ENABLED=1
7+
builds:
8+
- id: agent-browser-darwin-amd64
9+
binary: agent-browser
10+
main: ./cmd/agent-browser
11+
goarch:
12+
- amd64
13+
goos:
14+
- darwin
15+
env:
16+
- CC=o64-clang
17+
- CXX=o64-clang++
18+
flags:
19+
- -trimpath
20+
21+
- id: agent-browser-darwin-arm64
22+
binary: agent-browser
23+
main: ./cmd/agent-browser
24+
goarch:
25+
- arm64
26+
goos:
27+
- darwin
28+
env:
29+
- CC=oa64-clang
30+
- CXX=oa64-clang++
31+
flags:
32+
- -trimpath
33+
34+
- id: agent-browser-linux-amd64
35+
binary: agent-browser
36+
main: ./cmd/agent-browser
37+
goarch:
38+
- amd64
39+
goos:
40+
- linux
41+
env:
42+
- CC=x86_64-linux-gnu-gcc
43+
- CXX=x86_64-linux-gnu-g++
44+
flags:
45+
- -trimpath
46+
ldflags:
47+
- -s -w
48+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitCommit={{ .ShortCommit }}
49+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitTag={{ .Tag }}
50+
# - -X github.com/co-browser/agent-browser/v1/cmd.BuildDate={{ .Timestamp }}
51+
52+
- id: agent-browser-linux-arm64
53+
binary: agent-browser
54+
main: ./cmd/agent-browser
55+
goarch:
56+
- arm64
57+
goos:
58+
- linux
59+
env:
60+
- CC=aarch64-linux-gnu-gcc
61+
- CXX=aarch64-linux-gnu-g++
62+
flags:
63+
- -trimpath
64+
ldflags:
65+
- -s -w
66+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitCommit={{ .ShortCommit }}
67+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitTag={{ .Tag }}
68+
# - -X github.com/co-browser/agent-browser/v1/cmd.BuildDate={{ .Timestamp }}
69+
70+
- id: agent-browser-linux-armhf
71+
binary: agent-browser
72+
main: ./cmd/agent-browser
73+
goarch:
74+
- arm
75+
goarm:
76+
- 7
77+
goos:
78+
- linux
79+
env:
80+
- CC=arm-linux-gnueabihf-gcc
81+
- CXX=arm-linux-gnueabihf-g++
82+
flags:
83+
- -trimpath
84+
ldflags:
85+
- -s -w
86+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitCommit={{ .ShortCommit }}
87+
# - -X github.com/co-browser/agent-browser/v1/cmd.GitTag={{ .Tag }}
88+
# - -X github.com/co-browser/agent-browser/v1/cmd.BuildDate={{ .Timestamp }}
89+
90+
- id: agent-browser-windows-amd64
91+
binary: agent-browser
92+
main: ./cmd/agent-browser
93+
goarch:
94+
- amd64
95+
goos:
96+
- windows
97+
env:
98+
- CC=x86_64-w64-mingw32-gcc
99+
- CXX=x86_64-w64-mingw32-g++
100+
flags:
101+
- -trimpath
102+
- -buildmode=exe
103+
104+
- id: agent-browser-windows-386
105+
binary: agent-browser
106+
main: ./cmd/agent-browser
107+
goarch:
108+
- 386
109+
goos:
110+
- windows
111+
env:
112+
- CC=/llvm-mingw/bin/i686-w64-mingw32-gcc
113+
- CXX=/llvm-mingw/bin/i686-w64-mingw32-g++
114+
flags:
115+
- -trimpath
116+
- -buildmode=exe
117+
118+
119+
- id: agent-browser-windows-arm64
120+
binary: agent-browser
121+
main: ./cmd/agent-browser
122+
goarch:
123+
- arm64
124+
goos:
125+
- windows
126+
env:
127+
- CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
128+
- CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
129+
flags:
130+
- -trimpath
131+
- -buildmode=exe
132+
brews:
133+
- name: agent-browser
134+
repository:
135+
owner: co-browser
136+
name: homebrew-agent-browser
137+
token: "{{ .Env.GITHUB_TOKEN }}"
138+
139+
commit_author:
140+
name: cobrowser
141+
email: go@cobrowser.xyz
142+
homepage: "https://cobrowser.xyz"
143+
description: "a browser for agents"
144+
scoops:
145+
- name: agent-browser
146+
repository:
147+
owner: co-browser
148+
name: agent-browser-scoop
149+
commit_author:
150+
name: cobrowser
151+
email: go@cobrowser.xyz
152+
homepage: "https://cobrowser.xyz"
153+
description: "a browser for agents"
154+
license: MIT
155+
archives:
156+
- id: release/version
157+
ids:
158+
- agent-browser-darwin-amd64
159+
- agent-browser-darwin-arm64
160+
- agent-browser-linux-amd64
161+
- agent-browser-linux-arm64
162+
- agent-browser-linux-armhf
163+
- agent-browser-windows-amd64
164+
- agent-browser-windows-386
165+
- agent-browser-windows-arm64
166+
name_template: '{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ .Arm }}'
167+
wrap_in_directory: false
168+
formats: [ 'tar.gz' ]
169+
format_overrides:
170+
- goos: windows
171+
formats: [ 'zip' ]
172+
files:
173+
- LICENSE
174+
- README.md
175+
checksum:
176+
name_template: 'checksums.txt'
177+
algorithm: sha256
178+
snapshot:
179+
version_template: "{{ .Tag }}-next"
180+
changelog:
181+
sort: asc
182+
filters:
183+
exclude:
184+
- '^test:'

0 commit comments

Comments
 (0)