-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:getlago/lago-helm-charts into gh-pages
- Loading branch information
Showing
7 changed files
with
172 additions
and
41 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,42 @@ | ||
name: Prepare Release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to release' | ||
required: true | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Update Chart and Values Versions | ||
run: | | ||
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" Chart.yaml | ||
sed -i "s/^appVersion:.*/appVersion: '${{ github.event.inputs.tag }}'/" Chart.yaml | ||
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" values.yaml | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
commit-message: "chore(release): update to ${{ github.event.inputs.tag }}" | ||
branch: release/${{ github.event.inputs.tag }} | ||
base: main | ||
title: "Release ${{ github.event.inputs.tag }}" | ||
body: "This PR updates the chart versions to ${{ github.event.inputs.tag }}." | ||
labels: release | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
signoff: true | ||
update-existing-pr: 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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
name: Release Charts | ||
name: Release Charts on Merge | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to release' | ||
required: true | ||
default: '1.0.0' | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
release-on-merge: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -21,27 +18,65 @@ jobs: | |
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Installer jq | ||
run: sudo apt-get install jq | ||
|
||
- name: Check 'release' Label | ||
id: check_release_label | ||
run: | | ||
labels='${{ toJSON(github.event.pull_request.labels) }}' | ||
echo "Labels de la PR : $labels" | ||
if echo "$labels" | jq -e '.[] | select(.name=="release")' > /dev/null; then | ||
echo "has_release_label=true" >> $GITHUB_ENV | ||
else | ||
echo "has_release_label=false" >> $GITHUB_ENV | ||
fi | ||
- name: Lint Chart - Main chart | ||
run: helm lint . | ||
if: env.has_release_label == 'true' | ||
run: helm lint . | ||
|
||
- name: Update Dependencies | ||
run: helm dependency update . | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: "." | ||
config: cr.yaml | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
if: env.has_release_label == 'true' | ||
run: helm dependency update . | ||
|
||
- name: Deploy to GitHub Pages | ||
if: env.has_release_label == 'true' | ||
run: | | ||
git checkout gh-pages | ||
helm repo index . --url https://getlago.github.io/lago-helm-charts | ||
git pull origin main --rebase | ||
helm package . --destination charts/ | ||
helm repo index . --url https://getlago.github.io/charts | ||
git add . | ||
git commit -m "Update Helm repo index for tag ${{ github.event.inputs.tag }}" | ||
git add charts/ | ||
git commit -m "Update Helm repo index after release" | ||
git push origin gh-pages | ||
- name: Extract version from Chart.yaml | ||
if: env.has_release_label == 'true' | ||
id: get_version | ||
run: | | ||
version=$(grep '^version:' Chart.yaml | awk '{print $2}') | ||
echo "Extracted version: $version" | ||
echo "version=$version" >> $GITHUB_ENV | ||
- name: Create Git tag | ||
if: env.has_release_label == 'true' | ||
run: | | ||
git tag "v${{ env.version }}" | ||
git push origin "v${{ env.version }}" | ||
- name: Create GitHub Release | ||
if: env.has_release_label == 'true' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: "v${{ env.version }}" | ||
release_name: "Release v${{ env.version }}" | ||
body: "Release of version v${{ env.version }}" | ||
draft: false | ||
prerelease: false |
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,3 +1,2 @@ | ||
Chart.lock | ||
charts/*.tgz | ||
|
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