File tree Expand file tree Collapse file tree 5 files changed +84
-2
lines changed Expand file tree Collapse file tree 5 files changed +84
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+ on :
3+ push :
4+ tags :
5+ - ' v[0-9]+.[0-9]+.[0-9]+'
6+ - ' v*-test'
7+ jobs :
8+ release :
9+ permissions :
10+ contents : write
11+ pull-requests : write
12+ if : github.repository == 'kubernetes-sigs/karpenter-provider-cluster-api'
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v5
16+ with :
17+ fetch-depth : 0
18+ - run : make docgen
19+ - run : make release
20+ env :
21+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22+ GITHUB_REPO : ${{ github.repository }}
23+ - name : create pull request
24+ uses : actions/github-script@v8
25+ with :
26+ github-token : ${{ secrets.GITHUB_TOKEN }}
27+ script : |
28+ await github.rest.pulls.create({
29+ owner: context.repo.owner,
30+ repo: context.repo.repo,
31+ title: `chore(release): release ${context.ref_name} (automated)`,
32+ head: `release-${context.ref_name}`,
33+ base: 'main',
34+ body: `Release Changes for \`${context.ref_name}\`
35+
36+ ### Changes included:
37+ - Created release branch \`release-${context.ref_name}\`
38+ - Automatically generated documentation
39+ - Bumped Helm chart version to \`${context.ref_name}\`
40+
41+ This PR was generated automatically by karpenter-provider-cluster-api/.github/workflows/release.yml
42+ `
43+ draft: false
44+ });
Original file line number Diff line number Diff line change @@ -70,3 +70,11 @@ vendor: ## update modules and populate local vendor directory
7070 go mod tidy
7171 go mod vendor
7272 go mod verify
73+
74+ .PHONY : docgen
75+ docgen : # # Generate documentation files
76+ ./hack/docgen.sh
77+
78+ .PHONY : release
79+ release : # # Create a release branch, update chart version, and push changes
80+ ./hack/release.sh
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ The Kubernetes Template Project is released on an as-needed basis. The process i
44
551 . An issue is proposing a new release with a changelog since the last release
662 . All [ OWNERS] ( OWNERS ) must LGTM this release
7- 3 . Bump the ` version ` and ` appVersion ` of the Helm chart in ` charts/karpenter/Chart.yaml `
8- 4 . An OWNER runs ` git tag -s $VERSION ` and inserts the changelog and pushes the tag with ` git push $VERSION `
7+ 3 . An OWNER runs ` git tag -s $VERSION ` and inserts the changelog and pushes the tag with ` git push $VERSION `
8+ 4 . All [ OWNERS ] ( OWNERS ) must approve the release PR automatically created by GitHub Actions
995 . The release issue is closed
10106 . An announcement email is sent to
` [email protected] ` with the subject
` [ANNOUNCE] kubernetes-template-project $VERSION is released `
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -eu -o pipefail
3+
4+ go run hack/docs/settings_gen/main.go docs/docs/settings.md
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -eu -o pipefail
3+
4+ git_tag=" $( git describe --exact-match --tags || echo " none" ) "
5+ if [[ " ${git_tag} " != v* ]]; then
6+ echo " ::notice::This commit is no tagged."
7+ exit 1
8+ fi
9+
10+ git config user.name " Release"
11+ git config user.email
" [email protected] " 12+ git remote set-url origin " https://x-access-token:${GITHUB_TOKEN} @github.com/${GITHUB_REPO} "
13+
14+ branch_name=" release-${git_tag} "
15+ git checkout -b " ${branch_name} "
16+
17+ # Bump the version and appVersion of the Helm chart in charts/karpenter/Chart.yaml
18+ sed -i " s/^appVersion: .*/appVersion: \" ${git_tag# v} \" /" charts/karpenter/Chart.yaml
19+ sed -i " s/^version: .*/version: ${git_tag# v} /" charts/karpenter/Chart.yaml
20+
21+ git add go.mod
22+ git add go.sum
23+ git add docs/docs
24+ git add charts/karpenter
25+ git commit -m " chore(release): release ${git_tag} (automated)"
26+ git push --set-upstream origin " ${branch_name} "
You can’t perform that action at this time.
0 commit comments