Skip to content

Commit

Permalink
Use goreleaser to automatically build and publish releases
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Dec 31, 2021
1 parent 2a3fe97 commit 98910db
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
pull_request:
push:

permissions:
contents: write

jobs:
releaser:
name: Release
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Test
run: go test -v ./...
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
-
name: Archive binaries
uses: actions/upload-artifact@v2
with:
retention-days: 5
path: dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

dist/
84 changes: 84 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
project_name: go-check-ssl

before:
hooks:
- go mod download

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

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
- goos: darwin
goarch: 386
binary: '{{ .ProjectName }}'
ldflags: -s -w
flags:
- -trimpath

archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format_overrides:
- goos: windows
format: zip
files:
- README.md
- LICENSE

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incpatch .Version }}-next"

universal_binaries:
- replace: true
name_template: '{{ .ProjectName }}'

release:
footer: |
**Full Changelog**: https://github.com/colinodell/go-check-ssl/compare/{{ .PreviousTag }}...{{ .Tag }}
brews:
- tap:
owner: colinodell
name: homebrew-tap
commit_author:
name: Colin O'Dell
email: colinodell@gmail.com
folder: Formula
goarm: "7"
homepage: https://github.com/colinodell/go-check-ssl
description: Simple command line utility to check the status of an SSL certificate
license: MIT
install: |-
bin.install "{{ .ProjectName }}"
nfpms:
- file_name_template: '{{ .ConventionalFileName }}'
id: packages
homepage: https://github.com/colinodell/go-check-ssl
description: Simple command line utility to check the status of an SSL certificate
maintainer: Colin O'Dell <colinodell@gmail.com>
license: MIT
vendor: Colin O'Dell
formats:
- apk
- deb
- rpm

0 comments on commit 98910db

Please sign in to comment.