-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add automatic release support
- Loading branch information
1 parent
131d695
commit 5fc447d
Showing
7 changed files
with
119 additions
and
8 deletions.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
bin | ||
vendor | ||
/dist | ||
.netrc | ||
.vscode | ||
.vs | ||
|
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,41 @@ | ||
project_name: flux | ||
builds: | ||
- goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- 386 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- 6 | ||
- 7 | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
- goos: windows | ||
goarch: 386 | ||
main: ./cmd/flux | ||
env: | ||
- GO111MODULE=on | ||
ldflags: -s -w -X main.commit={{.Commit}} | ||
binary: flux | ||
|
||
archive: | ||
format: tar.gz | ||
wrap_in_directory: true | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ | ||
.Arm }}{{ end }}' | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
|
||
release: | ||
prerelease: auto | ||
name_template: "v{{.Version}}" | ||
|
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
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
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
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,13 @@ | ||
#!/bin/bash | ||
|
||
DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd) | ||
cd $DIR | ||
|
||
set -e | ||
|
||
export GO111MODULE=on | ||
|
||
version=$(go run ./cmd/changelog nextver) | ||
git tag -s -m "Release $version" $version | ||
git push origin $version | ||
go run github.com/goreleaser/goreleaser release --rm-dist --release-notes <(go run ./cmd/changelog generate --version $version --commit-url https://github.com/influxdata/flux/commit) |
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,14 @@ | ||
//+build tools | ||
|
||
package flux | ||
|
||
import ( | ||
_ "github.com/goreleaser/goreleaser" | ||
) | ||
|
||
// This package is a workaround for adding additional paths to the go.mod file | ||
// and ensuring they stay there. The build tag ensures this file never gets | ||
// compiled, but the go module tool will still look at the dependencies and | ||
// add/keep them in go.mod so we can version these paths along with our other | ||
// dependencies. When we run build on any of these paths, we get the version | ||
// that has been specified in go.mod rather than the master copy. |