Skip to content

Commit ba6afbd

Browse files
authoredOct 5, 2024··
Add github workflow to create releases on tag (#126)
1 parent 2f7d6e6 commit ba6afbd

File tree

2 files changed

+68
-9
lines changed

2 files changed

+68
-9
lines changed
 

‎.github/workflows/release.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: stable
23+
- name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v6
25+
with:
26+
distribution: goreleaser
27+
version: "~> v2"
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+

‎.goreleaser.yml

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
project_name: smug
23

34
before:
@@ -6,26 +7,53 @@ before:
67
builds:
78
- env:
89
- CGO_ENABLED=0
9-
ldflags:
10-
- "-X=main.version={{.Env.VERSION}}"
1110
goos:
1211
- linux
1312
- windows
1413
- darwin
1514
archives:
16-
- replacements:
17-
darwin: Darwin
18-
linux: Linux
19-
windows: Windows
20-
386: i386
21-
amd64: x86_64
15+
- format: tar.gz
16+
# this name template makes the OS and Arch compatible with the results of `uname`.
17+
name_template: >-
18+
"Bitbucket CLI {{ .Version }}"_
19+
{{- title .Os }}_
20+
{{- if eq .Arch "amd64" }}x86_64
21+
{{- else if eq .Arch "386" }}i386
22+
{{- else }}{{ .Arch }}{{ end }}
23+
{{- if .Arm }}v{{ .Arm }}{{ end }}
24+
# use zip for windows archives
25+
format_overrides:
26+
- goos: windows
27+
format: zip
28+
2229
checksum:
2330
name_template: 'checksums.txt'
2431
snapshot:
25-
name_template: "{{ .Tag }}-next"
32+
version_template: "{{ .Tag }}-next"
2633
changelog:
2734
sort: asc
2835
filters:
2936
exclude:
3037
- test
3138
- README
39+
40+
nfpms:
41+
- license: MIT
42+
maintainer: 'Ivaaaan hello@iillexial.me'
43+
homepage: https://github.com/ivaaaan/smug
44+
dependencies:
45+
- git
46+
description: Bitbucket client command line tool.
47+
formats:
48+
- deb
49+
- rpm
50+
contents:
51+
- src: ./completion/smug.bash
52+
dst: /usr/share/bash-completion/completions/smug
53+
file_info:
54+
mode: 0644
55+
- src: ./completion/smug.fish
56+
dst: /usr/share/fish/vendor_completions.d/smug.fish
57+
file_info:
58+
mode: 0644
59+

0 commit comments

Comments
 (0)
Please sign in to comment.