-
Notifications
You must be signed in to change notification settings - Fork 184
feat(ci): add automatic chart version bump workflow #411
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 1 commit
ab67679
a9c9f2d
b75ed91
a29ffc8
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,37 @@ | ||||
| name: Bump Chart Version | ||||
|
|
||||
| on: | ||||
| push: | ||||
| branches: | ||||
| - main | ||||
|
|
||||
| permissions: | ||||
| contents: read | ||||
|
|
||||
| jobs: | ||||
| bump-version: | ||||
| if: "!contains(github.actor, 'oauth2-proxy-bot')" | ||||
| runs-on: ubuntu-latest | ||||
| permissions: | ||||
| contents: write | ||||
| steps: | ||||
| - name: Checkout | ||||
| uses: actions/checkout@v4 | ||||
| with: | ||||
| ssh-key: "${{ secrets.PUSH_KEY }}" | ||||
| fetch-depth: 0 | ||||
|
|
||||
| - name: Configure Git | ||||
| run: | | ||||
| git config user.name "oauth2-proxy-bot" | ||||
| git config user.email "oauth2-proxy-bot@users.noreply.github.com" | ||||
|
|
||||
| - name: Bump Chart Version | ||||
| uses: GarnerCorp/build-actions/bump-version@main | ||||
|
pierluigilenoci marked this conversation as resolved.
Outdated
|
||||
| with: | ||||
| version-type: raw | ||||
| version-file-path: helm/oauth2-proxy/Chart.yaml | ||||
|
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. You'd probably want to do a bit more magic so that you can update this section: manifests/helm/oauth2-proxy/Chart.yaml Line 32 in 529c2f6
We weren't actively maintaining helm charts, so it wasn't something I was worried about, but I'm starting to do more work with helm charts, so I might add that support myself...
Member
Author
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. Good point! I added Would love your thoughts on whether the approach is sound — especially the changelog parsing logic. Happy to iterate! 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's pretty much what I envisioned when I designed this. Beyond this, I'd need some sample inputs and outputs to test it, but it feels about right.
Member
Author
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. Great to hear — thanks for the validation! I'll add a few example inputs/outputs to the script's header comments to make it easier to test and reason about. Will update the PR shortly.
Member
Author
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. Just pushed a fix and added the inline examples you mentioned. The script now has 5 documented test cases in the header (parse, update without log, two minor entries with PR refs, breaking change detection, no PR ref), and the changelog splice was rewritten in a single Python pass to avoid awk issues with multi-line strings containing slashes (URLs). Tested locally — all 5 cases produce the expected output. Happy to add a proper |
||||
| git-name: "oauth2-proxy-bot" | ||||
| git-email: "oauth2-proxy-bot@users.noreply.github.com" | ||||
| major: changelogs/major | ||||
| minor: changelogs/minor | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Changelogs | ||
|
|
||
| This directory drives the automatic version bump workflow. | ||
|
|
||
| When a PR modifies the Helm chart, include a file in the appropriate subdirectory: | ||
|
|
||
| - `minor/` — new feature (bumps `x.Y.0`) | ||
| - `major/` — breaking change (bumps `X.0.0`) | ||
| - No file needed for patch-only changes (CI fixes, doc tweaks) — the workflow defaults to patch | ||
|
|
||
| ## Filename | ||
|
|
||
| Use a descriptive name matching your PR, e.g.: | ||
| - `minor/add-runtimeclassname` | ||
| - `major/breaking-tpl-extrainitcontainers` | ||
|
|
||
| ## File content | ||
|
|
||
| Write a short description of the change. This becomes part of the version bump commit message. | ||
|
|
||
| Example (`minor/add-runtimeclassname`): | ||
| ``` | ||
| Add optional runtimeClassName field to the Deployment spec, enabling | ||
| users to run oauth2-proxy under alternative container runtimes such as | ||
| gVisor or Kata Containers. | ||
| ``` | ||
|
|
||
| ## How it works | ||
|
|
||
| On merge to `main`, the `bump-version` workflow reads files from these | ||
| directories, determines the bump type (major > minor > patch), updates | ||
| `version:` in `helm/oauth2-proxy/Chart.yaml`, commits, and pushes. | ||
| The changelog files are deleted as part of that commit. |
Uh oh!
There was an error while loading. Please reload this page.