Skip to content

Commit 91f992b

Browse files
feat: initial implementation
1 parent dedbbb4 commit 91f992b

File tree

10 files changed

+424
-27
lines changed

10 files changed

+424
-27
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: golangci/golangci-lint-action@v2
1515
build:
16-
runs-on: ${{ matrix.os }}
16+
runs-on: ubuntu-latest
1717
needs: lint
18-
strategy:
19-
fail-fast: true
20-
matrix:
21-
os: [macos-latest, windows-latest, ubuntu-latest]
2218
steps:
2319
- uses: actions/checkout@v2
2420
- uses: actions/setup-go@v2
2521
with:
2622
go-version: 1.17
2723
- run: go build ./cmd/hooks-goreleaser/
28-
- run: go test -v ./...
2924
release:
3025
runs-on: ubuntu-latest
3126
needs: build
@@ -34,7 +29,11 @@ jobs:
3429
- uses: actions/setup-go@v2
3530
with:
3631
go-version: 1.17
32+
- run: ./scripts/build-local.sh
3733
- uses: go-semantic-release/action@v1
3834
id: semrel
3935
with:
4036
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
custom-arguments: "--hooks goreleaser"
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea/
2+
dist/

.goreleaser.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
builds:
2+
- env:
3+
- CGO_ENABLED=0
4+
targets:
5+
- linux_amd64
6+
- linux_arm64
7+
- darwin_amd64
8+
- darwin_arm64
9+
- linux_arm
10+
- windows_amd64
11+
main: ./cmd/hooks-goreleaser
12+
ldflags:
13+
- -extldflags '-static'
14+
- -s -w -X github.com/go-semantic-release/hooks-goreleaser/pkg/hooks.HVERSION={{.Version}}
15+
16+
archives:
17+
- format: binary
18+
name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
19+
20+
checksum:
21+
name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt'

cmd/hooks-goreleaser/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package main
22

33
import (
4+
"github.com/apex/log"
5+
"github.com/fatih/color"
46
hooksGoReleaser "github.com/go-semantic-release/hooks-goreleaser/pkg/hooks"
57
"github.com/go-semantic-release/semantic-release/v2/pkg/hooks"
68
"github.com/go-semantic-release/semantic-release/v2/pkg/plugin"
79
)
810

911
func main() {
12+
log.SetHandler(hooksGoReleaser.NewLogHandler())
13+
color.NoColor = true
1014
plugin.Serve(&plugin.ServeOpts{
1115
Hooks: func() hooks.Hooks {
1216
return &hooksGoReleaser.GoReleaser{}

go.mod

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,154 @@ module github.com/go-semantic-release/hooks-goreleaser
33
go 1.17
44

55
require (
6+
github.com/apex/log v1.9.0
7+
github.com/fatih/color v1.13.0
68
github.com/go-semantic-release/semantic-release/v2 v2.19.0
79
github.com/goreleaser/goreleaser v1.4.1
810
)
911

1012
replace github.com/goreleaser/goreleaser v1.4.1 => ./goreleaser
1113

1214
require (
15+
cloud.google.com/go v0.99.0 // indirect
16+
cloud.google.com/go/kms v1.1.0 // indirect
17+
cloud.google.com/go/storage v1.18.2 // indirect
18+
code.gitea.io/sdk/gitea v0.15.1 // indirect
19+
github.com/AlekSi/pointer v1.2.0 // indirect
20+
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
21+
github.com/Azure/azure-sdk-for-go v60.2.0+incompatible // indirect
22+
github.com/Azure/azure-storage-blob-go v0.14.0 // indirect
23+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
24+
github.com/Azure/go-autorest/autorest v0.11.23 // indirect
25+
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
26+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.10 // indirect
27+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.4 // indirect
28+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
29+
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
30+
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
31+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
32+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
33+
github.com/DisgoOrg/disgohook v1.4.4 // indirect
34+
github.com/DisgoOrg/log v1.1.2 // indirect
35+
github.com/DisgoOrg/restclient v1.2.8 // indirect
36+
github.com/Masterminds/goutils v1.1.1 // indirect
37+
github.com/Masterminds/semver v1.5.0 // indirect
1338
github.com/Masterminds/semver/v3 v3.1.1 // indirect
39+
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
40+
github.com/Microsoft/go-winio v0.5.1 // indirect
41+
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect
42+
github.com/acomagu/bufpipe v1.0.3 // indirect
1443
github.com/alecthomas/jsonschema v0.0.0-20211209230136-e2b41affa5c1 // indirect
15-
github.com/apex/log v1.9.0 // indirect
16-
github.com/fatih/color v1.13.0 // indirect
44+
github.com/atc0005/go-teams-notify/v2 v2.6.0 // indirect
45+
github.com/aws/aws-sdk-go v1.42.24 // indirect
46+
github.com/aws/aws-sdk-go-v2 v1.11.2 // indirect
47+
github.com/aws/aws-sdk-go-v2/config v1.11.0 // indirect
48+
github.com/aws/aws-sdk-go-v2/credentials v1.6.4 // indirect
49+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.8.2 // indirect
50+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.2 // indirect
51+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.0.2 // indirect
52+
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.2 // indirect
53+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.5.2 // indirect
54+
github.com/aws/aws-sdk-go-v2/service/kms v1.11.1 // indirect
55+
github.com/aws/aws-sdk-go-v2/service/sso v1.6.2 // indirect
56+
github.com/aws/aws-sdk-go-v2/service/sts v1.11.1 // indirect
57+
github.com/aws/smithy-go v1.9.0 // indirect
58+
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb // indirect
59+
github.com/caarlos0/env/v6 v6.9.1 // indirect
60+
github.com/caarlos0/go-reddit/v3 v3.0.1 // indirect
61+
github.com/caarlos0/go-shellwords v1.0.12 // indirect
62+
github.com/cavaliergopher/cpio v1.0.1 // indirect
63+
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
64+
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
65+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
66+
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
67+
github.com/cncf/xds/go v0.0.0-20211216145620-d92e9ce0af51 // indirect
68+
github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb // indirect
69+
github.com/dghubble/oauth1 v0.7.1 // indirect
70+
github.com/dghubble/sling v1.4.0 // indirect
71+
github.com/dimchansky/utfbom v1.1.1 // indirect
72+
github.com/emirpasic/gods v1.12.0 // indirect
73+
github.com/envoyproxy/go-control-plane v0.10.1 // indirect
74+
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
1775
github.com/fsnotify/fsnotify v1.5.1 // indirect
76+
github.com/go-git/gcfg v1.5.0 // indirect
77+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
78+
github.com/go-git/go-git/v5 v5.4.2 // indirect
79+
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect
1880
github.com/gobwas/glob v0.2.3 // indirect
81+
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
82+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
1983
github.com/golang/protobuf v1.5.2 // indirect
84+
github.com/google/go-cmp v0.5.6 // indirect
85+
github.com/google/go-github/v41 v41.0.0 // indirect
86+
github.com/google/go-querystring v1.1.0 // indirect
87+
github.com/google/rpmpack v0.0.0-20211125064518-d0ed9b1b61b9 // indirect
88+
github.com/google/uuid v1.3.0 // indirect
89+
github.com/google/wire v0.5.0 // indirect
90+
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
91+
github.com/goreleaser/chglog v0.1.2 // indirect
2092
github.com/goreleaser/fileglob v1.2.0 // indirect
2193
github.com/goreleaser/nfpm/v2 v2.11.3 // indirect
94+
github.com/gorilla/websocket v1.4.2 // indirect
95+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
2296
github.com/hashicorp/go-hclog v1.0.0 // indirect
2397
github.com/hashicorp/go-plugin v1.4.0 // indirect
98+
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
99+
github.com/hashicorp/go-version v1.3.0 // indirect
24100
github.com/hashicorp/hcl v1.0.0 // indirect
25101
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
102+
github.com/huandu/xstrings v1.3.2 // indirect
26103
github.com/iancoleman/orderedmap v0.2.0 // indirect
104+
github.com/imdario/mergo v0.3.12 // indirect
27105
github.com/inconshreveable/mousetrap v1.0.0 // indirect
106+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
107+
github.com/jmespath/go-jmespath v0.4.0 // indirect
108+
github.com/kevinburke/ssh_config v1.1.0 // indirect
109+
github.com/klauspost/compress v1.13.6 // indirect
28110
github.com/magiconair/properties v1.8.5 // indirect
29111
github.com/mattn/go-colorable v0.1.12 // indirect
112+
github.com/mattn/go-ieproxy v0.0.1 // indirect
30113
github.com/mattn/go-isatty v0.0.14 // indirect
114+
github.com/mitchellh/copystructure v1.2.0 // indirect
115+
github.com/mitchellh/go-homedir v1.1.0 // indirect
31116
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
32117
github.com/mitchellh/mapstructure v1.4.3 // indirect
118+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
33119
github.com/oklog/run v1.0.0 // indirect
34120
github.com/pelletier/go-toml v1.9.4 // indirect
35121
github.com/pkg/errors v0.9.1 // indirect
122+
github.com/sergi/go-diff v1.2.0 // indirect
123+
github.com/slack-go/slack v0.10.1 // indirect
36124
github.com/spf13/afero v1.6.0 // indirect
37125
github.com/spf13/cast v1.4.1 // indirect
38126
github.com/spf13/cobra v1.3.0 // indirect
39127
github.com/spf13/jwalterweatherman v1.1.0 // indirect
40128
github.com/spf13/pflag v1.0.5 // indirect
41129
github.com/spf13/viper v1.10.0 // indirect
42130
github.com/subosito/gotenv v1.2.0 // indirect
131+
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
132+
github.com/ulikunitz/xz v0.5.10 // indirect
133+
github.com/xanzy/go-gitlab v0.52.2 // indirect
134+
github.com/xanzy/ssh-agent v0.3.1 // indirect
135+
go.opencensus.io v0.23.0 // indirect
136+
gocloud.dev v0.24.0 // indirect
137+
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
43138
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
139+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
140+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
44141
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
45142
golang.org/x/text v0.3.7 // indirect
143+
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
144+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
145+
google.golang.org/api v0.63.0 // indirect
146+
google.golang.org/appengine v1.6.7 // indirect
46147
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
47148
google.golang.org/grpc v1.43.0 // indirect
48149
google.golang.org/protobuf v1.27.1 // indirect
49-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
150+
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
50151
gopkg.in/ini.v1 v1.66.2 // indirect
152+
gopkg.in/mail.v2 v2.3.1 // indirect
153+
gopkg.in/warnings.v0 v0.1.2 // indirect
51154
gopkg.in/yaml.v2 v2.4.0 // indirect
155+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
52156
)

0 commit comments

Comments
 (0)