Skip to content

Commit 65c518c

Browse files
committed
ci: use goreleaser
1 parent 1b9f40c commit 65c518c

5 files changed

Lines changed: 82 additions & 5 deletions

File tree

.github/release/v0.0.4.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 🚀 New Release: `devops` v0.0.4
2+
3+
We are now supporting `goreleaser` for creating releases. This means that the
4+
CLI is now available as a binary for Linux, Windows, and MacOS.

.goreleaser.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
before:
12+
hooks:
13+
- go mod tidy
14+
15+
builds:
16+
- env:
17+
- CGO_ENABLED=0
18+
goos:
19+
- linux
20+
- windows
21+
- darwin
22+
23+
archives:
24+
- formats: [tar.gz]
25+
# this name template makes the OS and Arch compatible with the results of `uname`.
26+
name_template: >-
27+
{{ .ProjectName }}_
28+
{{- title .Os }}_
29+
{{- if eq .Arch "amd64" }}x86_64
30+
{{- else if eq .Arch "386" }}i386
31+
{{- else }}{{ .Arch }}{{ end }}
32+
{{- if .Arm }}v{{ .Arm }}{{ end }}
33+
# use zip for windows archives
34+
format_overrides:
35+
- goos: windows
36+
formats: [zip]
37+
38+
changelog:
39+
sort: asc
40+
filters:
41+
exclude:
42+
- "^docs:"
43+
- "^test:"
44+
45+
release:
46+
footer: >-
47+
48+
---
49+
50+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
21
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
3-
github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=
42
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
53
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
64
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -13,7 +11,6 @@ github.com/jgfranco17/dev-tooling-go v0.0.3 h1:lDjQCd1RC4t/kEQBPMQ+HOJnpNOOuUB0G
1311
github.com/jgfranco17/dev-tooling-go v0.0.3/go.mod h1:cjjYukhRfHJ+uE3IqnVVYrvrIy7rG13wY7rjJqGPHwM=
1412
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
1513
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
16-
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
1714
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1815
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1916
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -25,7 +22,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
2522
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
2623
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2724
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
28-
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
2925
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
3026
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
3127
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=

shared-actions/create-release/action.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ runs:
130130
- name: Create tag
131131
shell: bash
132132
if: steps.check_version.outputs.should_release == 'true'
133+
env:
134+
GITHUB_TOKEN: ${{ inputs.git-token }}
133135
run: |
134136
SPEC_VERSION="${{ steps.read_version.outputs.version }}"
135137
git config user.name "github-actions[bot]"
@@ -148,6 +150,31 @@ runs:
148150
--notes "${{ steps.changelog.outputs.changelog }}" \
149151
--latest
150152
153+
- name: Check for GoReleaser config
154+
shell: bash
155+
id: check_goreleaser
156+
if: steps.check_version.outputs.should_release == 'true'
157+
run: |
158+
# Check for common GoReleaser config file names
159+
if [ -f ".goreleaser.yml" ] || [ -f ".goreleaser.yaml" ] || [ -f "goreleaser.yml" ] || [ -f "goreleaser.yaml" ]; then
160+
echo "✅ GoReleaser configuration found"
161+
echo "has_config=true" >> $GITHUB_OUTPUT
162+
else
163+
echo "No GoReleaser configuration found, skipping artifact publishing"
164+
echo "has_config=false" >> $GITHUB_OUTPUT
165+
fi
166+
167+
- name: Publish artifacts with GoReleaser
168+
id: goreleaser-publish
169+
if: steps.check_version.outputs.should_release == 'true' && steps.check_goreleaser.outputs.has_config == 'true'
170+
uses: goreleaser/goreleaser-action@v6
171+
with:
172+
distribution: goreleaser
173+
version: "latest"
174+
args: release --clean
175+
env:
176+
GITHUB_TOKEN: ${{ inputs.git-token }}
177+
151178
- name: Skip release notification
152179
shell: bash
153180
if: steps.check_version.outputs.should_release == 'false'

specs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"author": "Joaquin Gabriel Franco",
33
"name": "devops",
44
"description": "DevOps: Simplifying your CI/CD pipelines.",
5-
"version": "0.0.3",
5+
"version": "0.0.4",
66
"repository": "https://github.com/jgfranco17/devops"
77
}

0 commit comments

Comments
 (0)