-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update the plugin's version as part of the release creation process #18
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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,72 @@ | ||
name: Version Plugin | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
|
||
# For all pushes that aren't creating a versioning commit | ||
if: ${{ !startsWith(github.event.commits[0].message, 'Version Helm Plugin') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: setup-node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Cache .pnpm-store | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.11.0 | ||
run_install: true | ||
|
||
- name: Install YQ | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Create Release Pull Request | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
commit: 'Version Helm Plugin' | ||
title: 'Version Helm Plugin' | ||
createGitHubReleases: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Determine whether version has changed | ||
id: changed_packages | ||
run: | | ||
packageVersion=$(yq -r .version package.json) | ||
pluginVersion=$(yq -r .version plugin.yaml) | ||
|
||
if [[ "packageVersion" != "pluginVersion" ]]; then | ||
echo "pluginChanged=true" >> $GITHUB_OUTPUT | ||
fi | ||
if: steps.changesets.outputs.hasChangesets == 'true' | ||
|
||
- name: 'Update version in plugin.yaml' | ||
run: | | ||
version=$(yq -r .version package.json) | ||
version="$version" yq -i '.version = strenv(version)' plugin.yaml | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
git add plugin.yaml | ||
git commit -m "Update plugin version in plugin.yaml" | ||
if: steps.changesets.outputs.hasChangesets == 'true' && steps.changed_packages.outputs.pluginChanged == 'true' | ||
|
||
- name: 'Push changes' | ||
run: | | ||
git push --set-upstream origin changeset-release/main | ||
if: steps.changesets.outputs.hasChangesets == 'true' |
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 |
---|---|---|
|
@@ -2,28 +2,44 @@ name: Release | |
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- 'main' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ startsWith(github.event.commits[0].message, 'Version Helm Plugin') }} | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
|
||
- name: Install YQ | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Get Version | ||
run: | | ||
version=$(yq -r .version plugin.yaml) | ||
echo "version=$version" >> $GITHUB_OUTPUT; | ||
echo "version=$version"; | ||
id: version | ||
|
||
- name: Tag Commit | ||
run: | | ||
git tag -f ${{ steps.version.outputs.version }} $(git rev-parse HEAD) | ||
git push origin refs/tags/${{ steps.version.outputs.version }} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
- | ||
name: Run GoReleaser | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
|
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 |
---|---|---|
|
@@ -14,3 +14,6 @@ go.work.sum | |
# Jetbrains IDE | ||
.idea | ||
dist/ | ||
|
||
# Nodejs | ||
node_modules |
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 @@ | ||
{ | ||
"name": "helm-migrate-values", | ||
"version": "0.2.2", | ||
"description": "Helm plugin for migrating user-provided release values between chart schema versions", | ||
"scripts": { | ||
"changeset": "changeset" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.8" | ||
}, | ||
"author": "Octopus Deploy", | ||
"license": "Apache-2.0" | ||
} |
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,5 @@ | ||
name: "migrate-values" | ||
version: "0.0.1" | ||
version: "0.2.2" | ||
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. Also updated the version directly here because there won't be a changeset associated with this PR (no changes to the actual migrator functionality itself). |
||
usage: "schema migration for Helm values" | ||
description: "Tool for ensuring user-supplied chart values are kept up to date with the chart's values schema." | ||
command: "$HELM_PLUGIN_DIR/bin/migrate-values" | ||
|
Oops, something went wrong.
Oops, something went wrong.
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.
I've set this to be the same as the version on the latest tag that we have