Skip to content

Commit

Permalink
pipeline: automatically bump chart version
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiStefanie committed Aug 5, 2024
1 parent 55cee3e commit 6f3128c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,34 @@ on:
- main

jobs:
release:
semrel:
name: Chart Versioning
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Generate the next version
uses: cycjimmy/semantic-release-action@v4
id: release
with:
dry_run: true
extra_plugins: |
@semantic-release/git
semantic-release-helm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
needs: semrel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
Expand All @@ -22,4 +43,4 @@ jobs:
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"branches": ["main"],
"ci": true,
"debug": false,
"dryRun": false,
"tagFormat": "kubernetes-agent-${version}",
"preset": "angular",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "build",
"release": "patch"
},
{
"type": "style",
"release": "patch"
},
{
"type": "test",
"release": "patch"
}
]
}
],
[
"semantic-release-helm",
{
"chartPath": "./charts/kubernetes-agent"
}
],
[
"@semantic-release/git",
{
"message": "chore(release): <%= nextRelease.version %> on <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %> [skip ci]",
"assets": ["charts/kubernetes-agent/Chart.yaml"]
}
]
]
}

0 comments on commit 6f3128c

Please sign in to comment.