Skip to content

Commit 7c7eaca

Browse files
authored
feat: add release and snapshot workflows for GoReleaser with devbox integration (#39)
1 parent 40a31b0 commit 7c7eaca

File tree

4 files changed

+268
-0
lines changed

4 files changed

+268
-0
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
goreleaser-release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
-
18+
name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '>=1.24'
26+
- name: Install devbox
27+
uses: jetify-com/devbox-install-action@v0.12.0
28+
with:
29+
enable-cache: true
30+
devbox-version: 0.14.0
31+
32+
-
33+
# Add support for more platforms with QEMU (optional)
34+
# https://github.com/docker/setup-qemu-action
35+
name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
-
38+
name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Login to GitHub Container Registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Install prerequisites
49+
shell: /usr/bin/bash {0}
50+
run: |
51+
devbox install
52+
devbox run release
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
56+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.github/workflows/snapshot.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: snapshot
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
goreleaser-snapshot:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Install Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '>=1.24'
23+
- name: Install devbox
24+
uses: jetify-com/devbox-install-action@v0.12.0
25+
with:
26+
enable-cache: true
27+
devbox-version: 0.14.0
28+
29+
-
30+
# Add support for more platforms with QEMU (optional)
31+
# https://github.com/docker/setup-qemu-action
32+
name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
-
35+
name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Login to GitHub Container Registry
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Install prerequisites
46+
shell: /usr/bin/bash {0}
47+
run: |
48+
devbox install
49+
devbox run snapshot
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
53+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

devbox.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.4/.schema/devbox.schema.json",
3+
"packages": [
4+
"goreleaser@2.9.0",
5+
"go-task@3.41.0",
6+
"golangci-lint@2.1.6"
7+
],
8+
"shell": {
9+
"init_hook": [
10+
"echo 'Welcome to devbox!' > /dev/null"
11+
],
12+
"scripts": {
13+
"build": [
14+
"task build"
15+
],
16+
"run": [
17+
"task run"
18+
],
19+
"linter": [
20+
"task linter"
21+
],
22+
"snapshot": [
23+
"task snapshot"
24+
],
25+
"release": [
26+
"task release"
27+
]
28+
}
29+
}
30+
}

devbox.lock

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {
4+
"go-task@3.41.0": {
5+
"last_modified": "2025-04-17T05:47:26Z",
6+
"resolved": "github:NixOS/nixpkgs/ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c#go-task",
7+
"source": "devbox-search",
8+
"version": "3.41.0",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"outputs": [
12+
{
13+
"name": "out",
14+
"path": "/nix/store/zz0ydwqf8s4dmdrhrd2i8h467mxsdgib-go-task-3.41.0",
15+
"default": true
16+
}
17+
],
18+
"store_path": "/nix/store/zz0ydwqf8s4dmdrhrd2i8h467mxsdgib-go-task-3.41.0"
19+
},
20+
"aarch64-linux": {
21+
"outputs": [
22+
{
23+
"name": "out",
24+
"path": "/nix/store/gw5m0vszm1arqri0f23x2myhn48njy8a-go-task-3.41.0",
25+
"default": true
26+
}
27+
],
28+
"store_path": "/nix/store/gw5m0vszm1arqri0f23x2myhn48njy8a-go-task-3.41.0"
29+
},
30+
"x86_64-darwin": {
31+
"outputs": [
32+
{
33+
"name": "out",
34+
"path": "/nix/store/hyp3mswald858k3kpbyc63h4dz2xfl18-go-task-3.41.0",
35+
"default": true
36+
}
37+
],
38+
"store_path": "/nix/store/hyp3mswald858k3kpbyc63h4dz2xfl18-go-task-3.41.0"
39+
},
40+
"x86_64-linux": {
41+
"outputs": [
42+
{
43+
"name": "out",
44+
"path": "/nix/store/h39sp829c75dccfp5jk8a5aqap4gpn8m-go-task-3.41.0",
45+
"default": true
46+
}
47+
],
48+
"store_path": "/nix/store/h39sp829c75dccfp5jk8a5aqap4gpn8m-go-task-3.41.0"
49+
}
50+
}
51+
},
52+
"golangci-lint@2.1.6": {
53+
"last_modified": "2025-05-06T08:06:31Z",
54+
"resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#golangci-lint",
55+
"source": "devbox-search",
56+
"version": "2.1.6",
57+
"systems": {
58+
"aarch64-linux": {
59+
"outputs": [
60+
{
61+
"name": "out",
62+
"path": "/nix/store/nzfzphypaibr5md38sqjm91i8azhynj4-golangci-lint-2.1.6",
63+
"default": true
64+
}
65+
],
66+
"store_path": "/nix/store/nzfzphypaibr5md38sqjm91i8azhynj4-golangci-lint-2.1.6"
67+
},
68+
"x86_64-linux": {
69+
"outputs": [
70+
{
71+
"name": "out",
72+
"path": "/nix/store/05p9lrvs0d7qqcd2vdks2lvmvi0kdp05-golangci-lint-2.1.6",
73+
"default": true
74+
}
75+
],
76+
"store_path": "/nix/store/05p9lrvs0d7qqcd2vdks2lvmvi0kdp05-golangci-lint-2.1.6"
77+
}
78+
}
79+
},
80+
"goreleaser@2.9.0": {
81+
"last_modified": "2025-04-30T16:14:55Z",
82+
"resolved": "github:NixOS/nixpkgs/70b191e2e0b1b5fe8586ad939dfa01f3047865f7#goreleaser",
83+
"source": "devbox-search",
84+
"version": "2.9.0",
85+
"systems": {
86+
"aarch64-darwin": {
87+
"outputs": [
88+
{
89+
"name": "out",
90+
"path": "/nix/store/80r1z38i8184lp7xxcs6ss9khszh4gyf-goreleaser-2.9.0",
91+
"default": true
92+
}
93+
],
94+
"store_path": "/nix/store/80r1z38i8184lp7xxcs6ss9khszh4gyf-goreleaser-2.9.0"
95+
},
96+
"aarch64-linux": {
97+
"outputs": [
98+
{
99+
"name": "out",
100+
"path": "/nix/store/pg2by80fn5i3dgxkl0ad4m56njvpjnax-goreleaser-2.9.0",
101+
"default": true
102+
}
103+
],
104+
"store_path": "/nix/store/pg2by80fn5i3dgxkl0ad4m56njvpjnax-goreleaser-2.9.0"
105+
},
106+
"x86_64-darwin": {
107+
"outputs": [
108+
{
109+
"name": "out",
110+
"path": "/nix/store/r879776j6ymhyd3fg1jlqsy4v5aca5nd-goreleaser-2.9.0",
111+
"default": true
112+
}
113+
],
114+
"store_path": "/nix/store/r879776j6ymhyd3fg1jlqsy4v5aca5nd-goreleaser-2.9.0"
115+
},
116+
"x86_64-linux": {
117+
"outputs": [
118+
{
119+
"name": "out",
120+
"path": "/nix/store/iibmw8lki8rf2kanzpg6c6n9llfq1737-goreleaser-2.9.0",
121+
"default": true
122+
}
123+
],
124+
"store_path": "/nix/store/iibmw8lki8rf2kanzpg6c6n9llfq1737-goreleaser-2.9.0"
125+
}
126+
}
127+
}
128+
}
129+
}

0 commit comments

Comments
 (0)