Skip to content

Commit

Permalink
infra(release): update goreleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpvik committed Jan 27, 2023
1 parent f3b575c commit 9fa2f39
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: release

on:
push:
branches:
- main
tags:
- "*"

Expand All @@ -26,10 +24,9 @@ jobs:
go-version: '^1.19'
check-latest: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ pkg/
*.zst
sema/
src/

dist/
47 changes: 39 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- binary: sema
goos:
- goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0
- GO111MODULES=on

release:
prerelease: auto

universal_binaries:
- replace: true

Expand All @@ -27,5 +31,32 @@ brews:
name: Viktor A. Rozenko Voitenko
email: sharp.vik@gmail.com

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"
name_template: 'checksums.txt'

changelog:
sort: asc
filters:
exclude:
- '^docs'
- '^test'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ const (
tags = "tags"
)

var Version string //* Set during build.
var version string //* Set during build.

var app = &cli.App{
Name: "sema",
Usage: "Semantic commits made simple",
Description: gitHubURL,
Version: Version,
Version: version,
Authors: []*cli.Author{{
Name: "Viktor A. Rozenko Voitenko",
Email: "sharp.vik@gmail.com",
Expand Down

0 comments on commit 9fa2f39

Please sign in to comment.