-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GoReleaser #80
GoReleaser #80
Changes from all commits
00cdab5
5a71700
7bcb7dc
153723a
2f54363
8f31239
f98da8f
add0b40
79c7ba1
3b243e4
8ed9ea6
30988a9
db10867
1076302
27e4c3d
b7e3e24
1295f3a
acc5b4a
f7f24fc
9117a57
eb500a2
fe34d08
f2eb293
2f8a78b
1861022
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: 2.1 | ||
jobs: | ||
release: | ||
docker: | ||
- image: circleci/golang:1.13 | ||
steps: | ||
- checkout | ||
- run: curl -sL https://git.io/goreleaser | bash | ||
build: | ||
docker: | ||
- image: circleci/golang:1.13 | ||
environment: | ||
GO111MODULE: "on" | ||
TEST_RESULTS: /tmp/test-results | ||
working_directory: /go/src/github.com/sonatype-nexus-community/nancy | ||
steps: | ||
- checkout | ||
- run: mkdir -p $TEST_RESULTS/gotest | ||
- restore_cache: | ||
keys: | ||
- go-mod-v1-{{ checksum "go.sum" }} | ||
- run: go mod download | ||
- run: go mod tidy | ||
- run: go get -u github.com/jstemmer/go-junit-report | ||
- run: go test ./... -v 2>&1 | go-junit-report > $TEST_RESULTS/gotest/report.xml | ||
- run: go build | ||
- run: cd testdata/dep && ../../nancy Gopkg.lock && cd - | ||
- run: ./nancy go.sum | ||
- run: go list -m all | ./nancy | ||
- save_cache: | ||
key: go-mod-v1-{{ checksum "go.sum" }} | ||
paths: | ||
- "/go/pkg/mod" | ||
- store_artifacts: | ||
path: /tmp/test-results/ | ||
- store_test_results: | ||
path: /tmp/test-results/ | ||
|
||
|
||
workflows: | ||
version: 2 | ||
build_and_release: | ||
jobs: | ||
- build | ||
- release: | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /v[0-9]+(\.[0-9]+)*(-.*)*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ nancy | |
#IntelliJ | ||
.idea | ||
*.iml | ||
dist/ |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,43 @@ | ||||||||||||||
before: | ||||||||||||||
hooks: | ||||||||||||||
- go mod download | ||||||||||||||
DarthHater marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
- go mod tidy | ||||||||||||||
builds: | ||||||||||||||
- | ||||||||||||||
ldflags: | ||||||||||||||
- -s -w -X "github.com/sonatype-nexus-community/nancy/buildversion.BuildVersion={{.Version}}" | ||||||||||||||
- -s -w -X "github.com/sonatype-nexus-community/nancy/buildversion.BuildTime={{time "2006-01-02T15:04:05Z07:00"}}" | ||||||||||||||
- -s -w -X "github.com/sonatype-nexus-community/nancy/buildversion.BuildCommit={{.FullCommit}}" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default value is a one liner, https://goreleaser.com/customization/#Builds
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not ANTI this, but I kinda like it as three separate commands (since it's doing it three different places). I don't have enough experience with goreleaser to know if one is preferable to the other. My main concern would be if one fails, etc... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The readability is I THINK easier with it broken out like this, is my main pro to having them the way I have it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But yours isn't bad for that either (it's just clear on the original that it's running -s -w -X on all three, at a quick glance) |
||||||||||||||
env: | ||||||||||||||
- CGO_ENABLED=0 | ||||||||||||||
goos: | ||||||||||||||
- linux | ||||||||||||||
- darwin | ||||||||||||||
- windows | ||||||||||||||
goarch: | ||||||||||||||
- amd64 | ||||||||||||||
- 386 | ||||||||||||||
|
||||||||||||||
archives: | ||||||||||||||
- | ||||||||||||||
name_template: "{{ .ProjectName }}-{{ .Os }}.{{ .Arch }}-v{{ .Version }}" | ||||||||||||||
format: binary | ||||||||||||||
|
||||||||||||||
checksum: | ||||||||||||||
name_template: "{{ .ProjectName }}checksums.txt" | ||||||||||||||
algorithm: sha256 | ||||||||||||||
|
||||||||||||||
snapshot: | ||||||||||||||
name_template: "{{ .Tag }}-next-{{.FullCommit}}" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this pull in the previous tag value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It pulls in the current tag value. The way GoReleaser works, is someone creates a tag, then CircleCI would start a build and release it. I preferred this a tiny bit to what we had before because it makes doing major and minor releases possible. Goreleaser also has a ton of functionality related to Docker, rpms, etc... that we could leverage. |
||||||||||||||
|
||||||||||||||
changelog: | ||||||||||||||
sort: asc | ||||||||||||||
filters: | ||||||||||||||
exclude: | ||||||||||||||
- '^docs:' | ||||||||||||||
- '^test:' | ||||||||||||||
|
||||||||||||||
release: | ||||||||||||||
github: | ||||||||||||||
owner: sonatype-nexus-community | ||||||||||||||
name: nancy |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
GO111MODULE: "on"
still necessary for go 1.13?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm gonna leave it for now, but with Go 1.14 I don't mind removing it?