Skip to content

Commit

Permalink
Introduce goreleaser to make the release of a new version easier
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed Oct 20, 2024
1 parent 08ff0c0 commit d21ca62
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/coverage.txt
/coverage.txt
dist/
23 changes: 23 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2

before:
hooks:
- go mod tidy

builds:
- skip: true

changelog:
use: github
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
name_template: "v{{ .Version }}"
footer: |
**Full Changelog**: https://github.com/andygrunwald/go-gerrit/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}

0 comments on commit d21ca62

Please sign in to comment.