Skip to content

Commit 2ad94bc

Browse files
committed
Auto releases
1 parent be6135d commit 2ad94bc

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

Diff for: .github/workflows/release.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- '*'
8+
9+
permissions:
10+
contents: write
11+
# packages: write
12+
# issues: write
13+
14+
jobs:
15+
goreleaser:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- run: git fetch --force --tags
22+
- uses: actions/setup-go@v3
23+
with:
24+
go-version: '1.21.5'
25+
cache: true
26+
# More assembly might be required: Docker logins, GPG, etc. It all depends
27+
# on your needs.
28+
- uses: goreleaser/goreleaser-action@v4
29+
with:
30+
# either 'goreleaser' (default) or 'goreleaser-pro':
31+
distribution: goreleaser
32+
version: latest
33+
args: release --clean
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
37+
# distribution:
38+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

Diff for: .goreleaser.yaml

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

0 commit comments

Comments
 (0)