Compare commits

...

22 Commits

Author SHA1 Message Date
Maxime Beauchemin
89bb6aefce debug tags 2024-11-25 16:36:18 -08:00
Maxime Beauchemin
02d86cc13d use v1.6.0 2024-11-25 16:20:38 -08:00
Maxime Beauchemin
81faf335b8 submodule update 2024-11-25 16:16:06 -08:00
Maxime Beauchemin
02a484de58 fix depth 0 2024-11-25 16:04:57 -08:00
Maxime Beauchemin
a4dfaf1cc3 debug tags 2024-11-25 16:01:59 -08:00
Maxime Beauchemin
e3a0832193 debug tags 2024-11-25 15:58:34 -08:00
Maxime Beauchemin
c8ac72a95e debug tags 2024-11-25 15:51:35 -08:00
Maxime Beauchemin
ae5a177b6a debug tags 2024-11-25 15:33:07 -08:00
Maxime Beauchemin
ad4e20b733 git submodule update 2024-11-25 14:57:47 -08:00
Maxime Beauchemin
4ff6d5098f fix js 2024-11-25 14:29:20 -08:00
Maxime Beauchemin
edbcdfe909 add ommited section 2024-11-25 14:22:54 -08:00
Maxime Beauchemin
bfba035552 github.sha 2024-11-25 14:18:47 -08:00
Maxime Beauchemin
0d363b4dbd persist creds 2024-11-25 14:12:08 -08:00
Maxime Beauchemin
db96032b6e GITHUB_TOKEN 2024-11-25 14:09:59 -08:00
Maxime Beauchemin
57e0625a54 fetch-depth: 1 2024-11-25 14:05:58 -08:00
Maxime Beauchemin
0b3276fa8e no commit 2024-11-25 14:05:04 -08:00
Maxime Beauchemin
a34151fdf7 force pushing 2024-11-25 13:58:52 -08:00
Maxime Beauchemin
7a837dec7d removing post-branch checkout 2024-11-25 13:48:33 -08:00
Maxime Beauchemin
4f70abab17 force create/push the branch 2024-11-25 13:46:05 -08:00
Maxime Beauchemin
283150d91e upgrade chart-releaser-action 2024-11-25 13:41:09 -08:00
Maxime Beauchemin
34a89c04b1 tweaks 2024-11-25 13:34:27 -08:00
Maxime Beauchemin
a2ae36e824 fix: helm chart deploy to open PRs to now-protected gh-pages branch
Cleaning up the mess I created by deleting the `gh-pages` branch by mistake while deleting hundreds of stale branches in the repo.

The changes here make it such that pushing a new helm chart version will now open a PR against the now-protected `gh-pages` branch, require a review and merge to be deployed.
2024-11-25 13:20:39 -08:00
3 changed files with 85 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
name: Lint and Test Charts
name: "Helm: lint and test charts"
on:
pull_request:

View File

@@ -1,4 +1,8 @@
name: Release Charts
# This workflow automates the release process for Helm charts.
# The workflow creates a new branch for the release and opens a pull request against the 'gh-pages' branch,
# allowing the changes to be reviewed and merged manually.
name: "Helm: release charts"
on:
push:
@@ -7,18 +11,28 @@ on:
- "[0-9].[0-9]*"
paths:
- "helm/**"
workflow_dispatch:
inputs:
ref:
description: "The branch, tag, or commit SHA to check out"
required: false
default: "master"
jobs:
release:
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ inputs.ref || github.ref_name }}
persist-credentials: true
submodules: recursive
fetch-depth: 0
@@ -35,11 +49,77 @@ jobs:
- name: Add bitnami repo dependency
run: helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Fetch/list all tags
run: |
# Debugging tags
git fetch --tags --force
git tag -d superset-helm-chart-0.13.4 || true
echo "DEBUG TAGS"
git show-ref --tags
- name: Create unique pages branch name
id: vars
run: echo "branch_name=helm-publish-${GITHUB_SHA:0:7}" >> $GITHUB_ENV
- name: Force recreate branch from gh-pages
run: |
# Ensure a clean working directory
git reset --hard
git clean -fdx
git checkout -b local_gha_temp
git submodule update
# Fetch the latest gh-pages branch
git fetch origin gh-pages
# Check out and reset the target branch based on gh-pages
git checkout -B ${{ env.branch_name }} origin/gh-pages
# Remove submodules from the branch
git submodule deinit -f --all
# Force push to the remote branch
git push origin ${{ env.branch_name }} --force
# Return to the original branch
git checkout local_gha_temp
- name: Fetch/list all tags
run: |
git submodule update
cat .github/actions/chart-releaser-action/action.yml
- name: Run chart-releaser
uses: ./.github/actions/chart-releaser-action
with:
version: v1.6.0
charts_dir: helm
mark_as_latest: false
pages_branch: ${{ env.branch_name }}
env:
CR_TOKEN: "${{ github.token }}"
CR_RELEASE_NAME_TEMPLATE: "superset-helm-chart-{{ .Version }}"
- name: Open Pull Request
uses: actions/github-script@v7
with:
script: |
const branchName = '${{ env.branch_name }}';
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
if (!branchName) {
throw new Error("Branch name is not defined.");
}
const pr = await github.rest.pulls.create({
owner,
repo,
title: `Helm chart release for ${branchName}`,
head: branchName,
base: "gh-pages", // Adjust if the target branch is different
body: `This PR releases Helm charts to the gh-pages branch.`,
});
core.info(`Pull request created: ${pr.data.html_url}`);
env:
BRANCH_NAME: ${{ env.branch_name }}