-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat: add go releaser #309
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -31,3 +31,5 @@ bin | |
**/*.csr | ||
**/server-csr.json | ||
.DS_Store | ||
|
||
dist/ |
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,55 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- | ||
# Binary name | ||
id: "kamaji" | ||
|
||
# Custom environment variables to be set during the builds. | ||
# Invalid environment variables will be ignored. | ||
# | ||
# Default: os.Environ() ++ env config section | ||
# Templates: allowed (since v1.14) | ||
env: | ||
- CGO_ENABLED=0 | ||
|
||
# GOOS list to build for. | ||
# For more info refer to: https://golang.org/doc/install/source#environment | ||
# | ||
# Default: [ 'darwin', 'linux', 'windows' ] | ||
goos: | ||
- linux | ||
|
||
# GOARCH to build for. | ||
# For more info refer to: https://golang.org/doc/install/source#environment | ||
# | ||
# Default: [ '386', 'amd64', 'arm64' ] | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
# Custom ldflags. | ||
ldflags: "-X github.com/clastix/kamaji/internal.GitRepo=${{.Env.GIT_REPO}} -X github.com/clastix/kamaji/internal.GitTag={{.Env.VERSION}} -X github.com/clastix/kamaji/internal.GitCommit={{.Env.GIT_HEAD_COMMIT}} -X github.com/clastix/kamaji/internal.GitDirty={{.Env.GIT_MODIFIED}} -X github.com/clastix/kamaji/internal.BuildTime={{.Env.BUILD_DATE}}" | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}amd64 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
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 |
---|---|---|
|
@@ -171,6 +171,24 @@ docker-build: ## Build docker image with the manager. | |
docker-push: ## Push docker image with the manager. | ||
docker push ${IMG} | ||
|
||
create-tag: # Add a tag to the current commit and push it to the remote repository. | ||
@git tag -a v$(VERSION) -m "Welcome to kamoji version $(VERSION)" | ||
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. Hey @dierbei thank you! There's a typo here in kamaji version |
||
@git push origin v$(VERSION) | ||
|
||
# Prerequisites: git is not in dirty state | ||
# If GITHUB_TOKEN exists, release a version according to the current tag. | ||
# If an error is encountered, the local tag and the remote tag will be deleted. | ||
# - use the VERSION as arg (e.g make release VERSION=0.4.0) | ||
# - use environment variables to overwrite this value (e.g export VERSION=0.4.0) | ||
release: create-tag | ||
GIT_REPO=$(GIT_REPO) \ | ||
GIT_HEAD_COMMIT=$(GIT_HEAD_COMMIT) \ | ||
VERSION=$(VERSION) \ | ||
GIT_MODIFIED=$(GIT_MODIFIED) \ | ||
BUILD_DATE=$(BUILD_DATE) \ | ||
goreleaser release --clean || \ | ||
(git tag -d v$(VERSION) && git push origin :refs/tags/v$(VERSION)) | ||
|
||
##@ Deployment | ||
|
||
metallb: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi @dierbei, about releasing also the manifests we can use the
release.extra_files
to include with a glob pattern manifest files expected to be released to install Kamaji from bare manifets.Then, update the
checksum
with the sameextra_files
content. What do you think?In any case @prometherion, we should have in place (also generated from the pipeline with GitHub actions), a manifest that contain CRDs and Kamaji plus default DataStore (or CRDs and deployments separated).