-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from LF-Decentralized-Trust-labs/ci-chart-rel…
…ease Simplify Helm Chart Release Process and Enhance CI Efficiency
- Loading branch information
Showing
7 changed files
with
217 additions
and
110 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,33 @@ | ||
name: 'Update YAML File' | ||
description: 'Update values in a YAML file' | ||
inputs: | ||
file: | ||
description: 'The path to the YAML file to update' | ||
required: true | ||
updates: | ||
description: 'YAML content with the updates to apply' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install yq | ||
shell: bash | ||
run: | | ||
wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O yq | ||
chmod +x yq | ||
sudo mv yq /usr/local/bin/ | ||
- name: Update YAML file | ||
shell: bash | ||
run: | | ||
set -e | ||
echo "Applying updates to ${{ inputs.file }}" | ||
# Write the updates to a temporary YAML file | ||
echo "${{ inputs.updates }}" > updates.yaml | ||
# Merge the updates into the target YAML file | ||
yq e -i '. * load("updates.yaml")' "${{ inputs.file }}" | ||
echo "Updated ${{ inputs.file }}:" | ||
cat "${{ inputs.file }}" |
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
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
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 |
---|---|---|
|
@@ -7,10 +7,25 @@ on: | |
required: false | ||
type: boolean | ||
default: false | ||
|
||
tag: | ||
required: true | ||
type: string | ||
description: 'The tag to release the chart and images with' | ||
|
||
jobs: | ||
build-images: | ||
# build and release images | ||
uses: ./.github/workflows/release-images.yaml | ||
with: | ||
tag: ${{ inputs.tag }} | ||
latest: ${{ inputs.latest }} | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
helm-chart-release: | ||
runs-on: ubuntu-latest | ||
needs: build-images | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
@@ -54,13 +69,58 @@ jobs: | |
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
# The makefile uses kustomize | ||
- uses: imranismail/setup-kustomize@v2 | ||
|
||
- name: Prepare CRD chart | ||
working-directory: operator | ||
run: gradle prepareCRDsChart | ||
run: ./gradlew prepareCRDsChart | ||
|
||
- name: Prepare operator chart | ||
run: ./gradlew prepareOperatorChart | ||
|
||
- name: Set Lowercase Repository Owner | ||
run: echo "LOWER_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | ||
|
||
# Override the image tags in the values.yaml file | ||
- name: Override image tags | ||
uses: ./.github/actions/update-yaml | ||
with: | ||
file: 'operator/charts/paladin-operator/values.yaml' | ||
updates: | | ||
operator: | ||
image: | ||
repository: docker.io/${{ env.LOWER_REPOSITORY_OWNER }}/paladin-operator | ||
tag: ${{ inputs.tag }} | ||
paladin: | ||
image: | ||
repository: docker.io/${{ env.LOWER_REPOSITORY_OWNER }}/paladin | ||
tag: ${{ inputs.tag }} | ||
# Remove 'v' prefix from the tag | ||
- name: Process Tag | ||
shell: bash | ||
run: | | ||
TAG="${{ inputs.tag }}" | ||
PROCESSED_TAG="${TAG#v}" | ||
echo "PROCESSED_TAG=${PROCESSED_TAG}" >> $GITHUB_ENV | ||
# Override the chart version in the Chart.yaml file | ||
- name: Override chart version | ||
uses: ./.github/actions/update-yaml | ||
with: | ||
file: 'operator/charts/paladin-operator/Chart.yaml' | ||
updates: | | ||
version: ${{ env.PROCESSED_TAG }} | ||
appVersion: ${{ inputs.tag }} | ||
- name: Confirm Helm temapltes | ||
working-directory: operator/charts/paladin-operator | ||
run: | | ||
helm dependency build | ||
helm template . | ||
rm -rf charts | ||
rm Chart.lock | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
|
Oops, something went wrong.