-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflows] Github workflows for synchronize a release and upload chart
* When a release is published, the `release-helm-chart` workflow will package the chart and upload it to the release page. Then sync with the kuadrant repo. For this is necessary to build the manifests and chart before the release. Running `make helm-build` with the require envs to be released * When a release is deleted, it will sync with the kuadrant repo Signed-off-by: dd di cesare <[email protected]>
- Loading branch information
1 parent
4ca8341
commit b86e8c3
Showing
2 changed files
with
76 additions
and
0 deletions.
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,23 @@ | ||
# Description: This workflow is used to communicate Kuadrant helm charts repo that a release has been deleted. | ||
|
||
name: Delete Release Helm Chart | ||
on: | ||
release: | ||
types: | ||
- deleted | ||
jobs: | ||
delete_chart_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Parse Tag | ||
run: | | ||
tag=${{ github.event.release.tag_name || inputs.operatorTag }} | ||
echo "OPERATOR_VERSION=${tag#v}" >> $GITHUB_ENV | ||
- name: Sync deleted Helm Chart with repository | ||
run: | | ||
make helm-sync-package-deleted \ | ||
VERSION=${{env.OPERATOR_VERSION}} \ | ||
HELM_WORKFLOWS_TOKEN=${{ secrets.HELM_WORKFLOWS_TOKEN }} |
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,53 @@ | ||
# Description: This workflow is used to release the Helm chart to the GitHub repository. The chart manifests should be already | ||
# built with the target `helm-build` and the manifests changes already committed to the tag to be released. | ||
|
||
name: Release Helm Chart | ||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
inputs: | ||
operatorTag: | ||
description: Operator bundle version tag | ||
default: v0.0.0 | ||
type: string | ||
jobs: | ||
chart_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Package Helm Chart | ||
run: | | ||
make helm-package | ||
- name: Parse Tag | ||
run: | | ||
tag=${{ github.event.release.tag_name || inputs.operatorTag }} | ||
echo "OPERATOR_VERSION=${tag#v}" >> $GITHUB_ENV | ||
echo "OPERATOR_TAG=${tag}" >> $GITHUB_ENV | ||
- name: Upload package to GitHub Release | ||
uses: svenstaro/upload-release-action@v2 | ||
id: upload-chart | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: limitador-operator-${{ env.OPERATOR_VERSION }}.tgz | ||
asset_name: chart-limitador-operator-${{ env.OPERATOR_VERSION }}.tgz | ||
tag: ${{ env.OPERATOR_TAG }} | ||
overwrite: true | ||
|
||
- name: Sync Helm Chart with repository | ||
run: | | ||
make helm-sync-package-created \ | ||
VERSION=${{env.OPERATOR_VERSION}} \ | ||
HELM_WORKFLOWS_TOKEN=${{ secrets.HELM_WORKFLOWS_TOKEN }} \ | ||
BROWSER_DOWNLOAD_URL=${{ steps.upload-chart.outputs.browser_download_url }} |