Skip to content

Commit 2d4538f

Browse files
committed
Fix: Goreleaser
1 parent 8a6d60a commit 2d4538f

File tree

2 files changed

+66
-68
lines changed

2 files changed

+66
-68
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,41 @@
1-
name: qrterminal release
1+
name: Release
22

33
on:
44
push:
55
tags:
6-
- "*"
6+
- 'v*'
77

88
permissions:
9-
contents: write
10-
packages: write
11-
9+
contents: write # This is required for creating releases
10+
packages: write # This is required for pushing to ghcr.io
11+
1212
jobs:
13-
Build:
14-
runs-on: ubuntu-20.04
15-
env:
16-
DOCKER_BUILDKIT: 1
13+
goreleaser:
14+
runs-on: ubuntu-latest
1715
steps:
18-
- name: Set up Go
19-
uses: actions/setup-go@v3
20-
with:
21-
go-version: "^1.20.4"
22-
- name: Source checkout
16+
- name: Checkout
2317
uses: actions/checkout@v3
2418
with:
2519
fetch-depth: 0
26-
- name: Fetch all tags
27-
run: git fetch --force --tags
28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v2
30-
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v2
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v4
3223
with:
33-
driver: docker
34-
install: true
35-
- name: GitHub Container Registry Login
24+
go-version: '1.23'
25+
26+
- name: Login to GitHub Container Registry
3627
uses: docker/login-action@v2
3728
with:
3829
registry: ghcr.io
3930
username: ${{ github.actor }}
4031
password: ${{ secrets.GITHUB_TOKEN }}
41-
- uses: goreleaser/goreleaser-action@v3
42-
name: Publish qrterminal
32+
33+
- name: Run GoReleaser
34+
uses: goreleaser/goreleaser-action@v4
4335
with:
4436
distribution: goreleaser
4537
version: latest
46-
args: release --timeout 50m
38+
args: release --clean
4739
env:
4840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
GORELEASER_TOKEN_TAP: ${{ secrets.GORELEASER_TOKEN_TAP }}
41+
GORELEASER_TOKEN_TAP: ${{ secrets.GORELEASER_TOKEN_TAP }}

.goreleaser.yaml

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
# This is an example .goreleaser.yml file with some sensible defaults.
22
# 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+
311
before:
412
hooks:
513
# You may remove this if you don't use go modules.
614
- go mod tidy
715
# you may remove this if you don't need go generate
816
- go generate ./...
9-
release:
10-
github:
11-
owner: mdp
12-
name: qrterminal
13-
draft: false
14-
# If set to auto, will mark the release as not ready for production
15-
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
16-
# If set to true, will mark the release as not ready for production.
17-
# Default is false.
18-
prerelease: auto
1917

2018
builds:
21-
-
22-
main: ./cmd/qrterminal/main.go
23-
binary: qrterminal
24-
env:
25-
- CGO_ENABLED=0
26-
goos:
27-
- linux
28-
- windows
29-
- darwin
19+
- main: ./cmd/qrterminal/main.go
20+
binary: qrterminal
21+
env:
22+
- CGO_ENABLED=0
23+
goos:
24+
- linux
25+
- windows
26+
- darwin
3027

3128
archives:
32-
- format: tar.gz
33-
# this name template makes the OS and Arch compatible with the results of uname.
29+
- formats: [tar.gz]
30+
# this name template makes the OS and Arch compatible with the results of `uname`.
3431
name_template: >-
3532
{{ .ProjectName }}_
3633
{{- title .Os }}_
@@ -40,36 +37,50 @@ archives:
4037
{{- if .Arm }}v{{ .Arm }}{{ end }}
4138
# use zip for windows archives
4239
format_overrides:
43-
- goos: windows
44-
format: zip
40+
- goos: windows
41+
formats: [zip]
4542
files:
4643
- LICENSE
4744
- README.md
4845
- CHANGELOG.md
4946
rlcp: true
47+
5048
checksum:
5149
name_template: 'checksums.txt'
50+
5251
snapshot:
5352
name_template: "{{ incpatch .Version }}-next"
53+
5454
changelog:
5555
sort: asc
5656
filters:
5757
exclude:
58-
- '^docs:'
59-
- '^test:'
58+
- "^docs:"
59+
- "^test:"
6060

61-
brews:
62-
-
63-
name: qrterminal
64-
tap:
61+
release:
62+
github:
6563
owner: mdp
66-
name: homebrew-tap
67-
token: "{{ .Env.GORELEASER_TOKEN_TAP }}"
68-
commit_author:
69-
name: mdp
70-
71-
homepage: https://github.com/mdp/qrterminal
72-
description: 'Create and display QR codes on the command line'
64+
name: qrterminal
65+
draft: false
66+
prerelease: auto
67+
footer: >-
68+
69+
---
70+
71+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
72+
73+
brews:
74+
- name: qrterminal
75+
tap:
76+
owner: mdp
77+
name: homebrew-tap
78+
token: "{{ .Env.GORELEASER_TOKEN_TAP }}"
79+
commit_author:
80+
name: mdp
81+
82+
homepage: https://github.com/mdp/qrterminal
83+
description: 'Create and display QR codes on the command line'
7384

7485
dockers:
7586
- image_templates:
@@ -99,8 +110,3 @@ docker_manifests:
99110
image_templates:
100111
- ghcr.io/mdp/qrterminal:{{ .Tag }}-amd64
101112
- ghcr.io/mdp/qrterminal:{{ .Tag }}-arm64
102-
103-
# The lines beneath this are called `modelines`. See `:help modeline`
104-
# Feel free to remove those if you don't want/use them.
105-
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
106-
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)