Skip to content

Commit

Permalink
revamp goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
jftuga committed Nov 26, 2023
1 parent 0132da0 commit f71c822
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 73 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_dispatch:
# push:
# tags:
# - "*"

permissions:
contents: write

jobs:
build:
name: GoReleaser Build
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set Up Go
uses: actions/setup-go@v4
with:
go-version: "1.x"
id: go

- name: run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: ~> 1.23
args: release --clean -p 2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 0 additions & 29 deletions .github/workflows/goreleaser.yml

This file was deleted.

123 changes: 79 additions & 44 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,82 @@
project_name: sns_publish
build:
main: .
binary: sns_publish
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
- freebsd
goarch:
- amd64
- arm
- arm64
- mips
goarm:
- 6
- 7
ignore:
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: mips
- goos: windows
goarch: arm
goarm: 7
- goos: windows
goarch: arm
goarm: 6
- goos: linux
goarch: arm64
before:
hooks:
- go mod tidy

builds:
- id: id1
binary: sns_publish
ldflags:
- -extldflags "-static" -s -w -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- linux
- freebsd
- darwin
goarch:
- amd64
- arm64
- arm
- ppc64le
goarm:
- "7"
ignore:
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: arm
- goos: freebsd
goarch: ppc64le
- goos: darwin
goarch: arm
- goos: darwin
goarch: ppc64le

- id: id2
binary: sns_publish
ldflags:
- -extldflags "-static" -s -w -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64
hooks:
post:
- upx -9 "{{ .Path }}"

archives:
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ .Arm }}"
format: tar.xz
format_overrides:
- goos: windows
format: zip
replacements:
darwin: macOS
wrap_in_directory: true
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.xz
format_overrides:
- goos: windows
format: zip
wrap_in_directory: true
files:
- LICENSE
- README.md

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}--sha256_checksums.txt"
name_template: "{{ .ProjectName }}_{{ .Version }}--checksums.txt"
release:
draft: true
draft: false
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

brews:
- name: sns_publish
repository:
owner: jftuga
name: homebrew-tap
commit_author:
name: jftuga
email: jftuga@users.noreply.github.com
homepage: https://github.com/jftuga/sns_publish
description: "command line tool to send message or file to AWS SNS topic subscribers"
test: system "#{bin}/sns_publish -v"
install: bin.install "sns_publish"

0 comments on commit f71c822

Please sign in to comment.