Skip to content

Commit

Permalink
ci: release helm chart should be done after a new release is created
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Mar 19, 2024
1 parent 26597cb commit 40cbd01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
template: |
# What's Changed
## What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
## Full Changelog
- https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
name-template: "Version $RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"

Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_dispatch:

jobs:

check-branches:
name: Check branches
runs-on: self-hosted
Expand Down Expand Up @@ -37,6 +38,7 @@ jobs:
pull-requests: write
runs-on: self-hosted
steps:
# create a new release
- id: update_release_draft
uses: release-drafter/release-drafter@v6
env:
Expand All @@ -45,9 +47,18 @@ jobs:
publish: true
disable-autolabeler: true

- id: get_latest_release
run: |
LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
| jq -r .tag_name)
echo "LATEST_RELEASE=$LATEST_RELEASE" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

helm-push:
name: "Helm: push chart to OCI registry"
needs: ci
needs: update_release_draft
runs-on: self-hosted
steps:
# Get a local copy of the code
Expand Down Expand Up @@ -79,8 +90,8 @@ jobs:
chart-folder: helm/chart
force: true
update-dependencies: true
version: ${{ github.event.inputs.tagVersion }}
appVersion: ${{ github.event.inputs.tagVersion }}
version: ${{ env.LATEST_RELEASE }}
appVersion: ${{ env.LATEST_RELEASE }}
env:
OCI_REGISTRY: ${{ vars.OCI_REGISTRY }}
OCI_REGISTRY_USERNAME: ${{ vars.OCI_REGISTRY_USERNAME }}
Expand Down

0 comments on commit 40cbd01

Please sign in to comment.