-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Added goreleaser config for generating release notes and pre release creation #2788
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
base: main
Are you sure you want to change the base?
Changes from all commits
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,47 @@ | ||
name: Pre-release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
discussions: write | ||
|
||
jobs: | ||
build-and-create-prerelease: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout (full history) | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
id: go | ||
- name: Extract versions from go.mod | ||
id: versions | ||
run: | | ||
# Extract Go version from go.mod | ||
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}') | ||
echo "go-version=${GO_VERSION}" >> $GITHUB_OUTPUT | ||
|
||
# Extract k8s.io/client-go version from go.mod | ||
CLIENT_GO_VERSION=$(go list -m -f '{{.Version}}' k8s.io/client-go) | ||
echo "client-go-version=${CLIENT_GO_VERSION}" >> $GITHUB_OUTPUT | ||
|
||
echo "📦 Go version: ${GO_VERSION}" | ||
echo "📦 k8s.io/client-go version: ${CLIENT_GO_VERSION}" | ||
- name: Make pre-release | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GO_VERSION: ${{ steps.versions.outputs.go-version }} | ||
K8S_CLIENT_VERSION: ${{ steps.versions.outputs.client-go-version }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
version: 2 | ||
|
||
archives: | ||
- formats: [tar.gz] | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
|
||
changelog: | ||
use: github | ||
sort: asc | ||
groups: | ||
- title: "Features" | ||
regexp: "(?i)(feat|feature|\\[feature\\]|\\[feat\\]|\\bFEATURE\\b)" | ||
order: 1 | ||
- title: "Bug Fixes" | ||
regexp: "(?i)(fix|bugfix|\\[bugfix\\]|\\[BUGFIX\\]|\\bBUGFIX\\b)" | ||
order: 2 | ||
- title: "Documentation" | ||
regexp: "(?i)(docs?|documentation|\\[docs?\\])" | ||
order: 3 | ||
- title: "Dependencies" | ||
regexp: "(?i)(build\\(deps\\)|bump|dependencies)" | ||
order: 4 | ||
- title: "Maintenance" | ||
regexp: "(?i)(chore|refactor|\\[chore\\])" | ||
order: 5 | ||
- title: "Other Changes" | ||
regexp: ".*" | ||
order: 99 | ||
|
||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- 'merge conflict' | ||
- 'Merge branch' | ||
- 'Merge pull request' | ||
|
||
release: | ||
github: | ||
owner: kubernetes | ||
name: kube-state-metrics | ||
|
||
prerelease: "true" | ||
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.
Do we plan on running a 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 was thinking of creating a seperate post release workflow (for merging back to main and running kpromo first) after which we can mark the release as the main release manually (we need to do mark it as main manually because it needs to be done after the merging of the kpromo PR & the 7 day wait period). |
||
|
||
header: | | ||
## {{ .Tag }} / {{ .Now.Format "2006-01-02" }} | ||
|
||
{{- if index .Env "GO_VERSION" }} | ||
## Note | ||
- This release builds with Go `{{ index .Env "GO_VERSION" }}` | ||
{{- end }} | ||
|
||
{{- if index .Env "K8S_CLIENT_VERSION" }} | ||
- This release builds with `k8s.io/client-go`: `{{ index .Env "K8S_CLIENT_VERSION" }}` | ||
{{- end }} | ||
|
||
footer: | | ||
**Full Changelog**: {{ .GitURL }}/compare/{{ .PreviousTag }}...{{ .Tag }} | ||
|
||
mode: replace | ||
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 believe we'll need to use this to export the openvex and SBOMs? Or is that done without this already? 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. they're built currently on creating a main release automatically, I don't think we should add them in pre-release here. |
||
|
||
# If set, will create a release discussion in the category specified. | ||
# Warning: do not use categories in the 'Announcement' format. | ||
# Check https://github.com/goreleaser/goreleaser/issues/2304 for more info. | ||
# Default: ''. | ||
discussion_category_name: Releases |
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.
Discussions should allow user to report concerns between the prerelease-to-release period.