Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f01d49e
commit f0e0f7e
Showing
4 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: smtpdane tool release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
# Control the GITHUB_TOKEN permissions; GitHub's docs on which permission scopes control what are a little lacking. | ||
# By having this block, all permissions not listed here are set to none. | ||
# | ||
# <https://goreleaser.com/ci/actions/> documents which scopes are needed for it. | ||
# Uploading archives as release artifacts is bundled into the contents: permission key! (goreleaser documents as content: but it's contents:). | ||
# packages: is for pushing docker images to github (ghcr.io) | ||
# actions: is for uploading artifacts | ||
contents: write | ||
packages: write | ||
actions: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# NB: the `fetch-depth: 0` setting is documented by goreleaser | ||
# as a requirement, for the changelog feature to work correctly. | ||
fetch-depth: 0 | ||
|
||
# If we had something suitable for a Docker image, here we would setup QEMU and BuildX | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20.x' | ||
check-latest: true | ||
|
||
- name: Basic Go integrity checks | ||
run: | | ||
go vet ./... | ||
t="$(go list -m -retracted -f '{{if .Retracted}}::error file=go.mod::{{.Path}} is retracted{{end}}' all)" | ||
if [ ".$t" != "." ]; then printf '%s\n' "$t"; exit 1; fi | ||
- name: Run GoReleaser | ||
id: goreleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ smtpdane | |
|
||
coverage.out | ||
c.partial.out | ||
|
||
# goreleaser | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
- freebsd | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
- goos: windows | ||
goarch: arm64 | ||
|
||
# reproducible builds: | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
flags: | ||
- "-trimpath" | ||
# ldflags: Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`. | ||
# We switch the .Date to .CommitDate per advice at bottom of <https://goreleaser.com/customization/build/> re reproducibility. | ||
ldflags: | ||
- "-s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.CompileDate={{.CommitDate}} -X main.BuiltBy=goreleaser" | ||
|
||
archives: | ||
- format: tar.gz | ||
wrap_in_directory: true | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
checksum: | ||
name_template: 'SHA256SUMS' | ||
algorithm: sha256 | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
nfpms: | ||
- file_name_template: 'smtpdane-{{.Version}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}' | ||
homepage: https://go.pennock.tech/smtpdane | ||
description: SMTP DANE Tester | ||
maintainer: Phil Pennock <phil@pennock-tech.com> | ||
license: MIT | ||
vendor: Pennock Tech, LLC | ||
bindir: /usr/local/bin | ||
formats: | ||
- deb | ||
- rpm | ||
|
||
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters