Skip to content

Commit

Permalink
Package and GitHub updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Feb 27, 2024
1 parent 9d433a7 commit 9f38c47
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 175 deletions.
73 changes: 0 additions & 73 deletions .brew/.goreleaser.yml

This file was deleted.

19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
name: goreleaser

on:
pull_request:
push:
tags:
- "*"
- "v*"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.18
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tests
run: |
go mod tidy
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93 changes: 23 additions & 70 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,74 @@
#
# test the config:
# goreleaser check
# goreleaser release --skip-publish --skip-validate --rm-dist
# goreleaser release --skip=publish --skip=validate --clean

before:
hooks:
- go mod tidy

builds:
- main: ./cmd/myip
id: FreeBSD
goos: ["freebsd"]
goarch: ["amd64"]

- main: ./cmd/myip
id: Linux Intel
id: Linux_Intel
goos: ["linux"]
goarch: ["amd64"]

- main: ./cmd/myip
id: Linux arm
id: Linux_arm64
goos: ["linux"]
goarch: ["arm", "arm64"]

- main: ./cmd/myip
id: macOS
goos: ["darwin"]
goarch: ["amd64", "arm64"]

- main: ./cmd/myip
id: Windows
goos: ["windows"]
goarch: ["amd64"]
universal_binaries:
- id: macOS
name_template: "{{ .ProjectName }}"
replace: true

archives:
archives:
- id: FreeBSD
builds: ["FreeBSD"]
builds: ['BSD']
format: tar.gz
files:
- none*
- none*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
amd64: Intel
freebsd: FreeBSD
- id: Linux Intel
builds: ["Linux Intel"]
- id: Linux_Intel
builds: ['Linux_Intel']
format: tar.gz
files:
- none*
- none*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
amd64: Intel
linux: Linux
- id: Linux arm
builds: ["Linux arm"]
- id: Linux_arm64
builds: ['Linux_arm64']
format: tar.gz
files:
- none*
- none*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
arm: arm32_
arm64: arm64
linux: Linux
- id: macOS
builds: ["macOS"]
builds: ['macOS']
format: tar.gz
files:
- none*
- none*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
arm64: M-series
amd64: Intel
darwin: macOS
- id: Windows
builds: ["Windows"]
builds: ['Windows']
format: zip
files:
- none*
- none*
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
replacements:
amd64: Intel
windows: Windows

universal_binaries:
- id: macOS
name_template: "{{ .ProjectName }}"
replace: true

nfpms:
- id: Linux
builds: ["Linux Intel"]
builds: ['Linux_Intel']
file_name_template: "{{ .ProjectName }}"
replacements:
amd64: Intel
linux: Linux
vendor: Ben Garrett.
homepage: https://github.com/bengarrett/myip
maintainer: Ben Garrett <code.by.ben@gmail.com>
Expand All @@ -103,27 +79,4 @@ nfpms:
- apk
- deb
- rpm

scoop:
bucket:
owner: bengarrett
name: myip

commit_author:
name: goreleaserbot
email: goreleaser@carlosbecker.com

commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"

homepage: "https://github.com/bengarrett/myip/"

description: "Determine your Internet-facing IP address and location from multiple sources."

license: MIT

# Setting this will prevent goreleaser to actually try to commit the updated
# manifest leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the scoop bucket
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: auto
- archlinux
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ module github.com/bengarrett/myip

go 1.18

require github.com/oschwald/maxminddb-golang v1.8.0
require github.com/oschwald/maxminddb-golang v1.12.0

require (
github.com/davecgh/go-spew v1.1.1 // indirect
golang.org/x/sys v0.1.0 // indirect
)
require golang.org/x/sys v0.17.0 // indirect
20 changes: 6 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/oschwald/maxminddb-golang v1.8.0 h1:Uh/DSnGoxsyp/KYbY1AuP0tYEwfs0sCph9p/UMXK/Hk=
github.com/oschwald/maxminddb-golang v1.8.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis=
github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs=
github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 comments on commit 9f38c47

Please sign in to comment.