mirror of
https://github.com/henrygd/beszel.git
synced 2026-08-17 04:36:17 +00:00
fix(helm): publish and index chart releases reliably, maybe
- Serialize release runs to prevent GitHub Pages index races - Publish drafts using the release ID from Release Please - Keep Helm chart releases out of the latest release channel - Publish releases before Chart Releaser indexes them - Match Chart Releaser to v-prefixed release tags
This commit is contained in:
@@ -18,6 +18,10 @@ env:
|
||||
|
||||
name: helm-release
|
||||
|
||||
concurrency:
|
||||
group: helm-release
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
@@ -73,6 +77,7 @@ jobs:
|
||||
env:
|
||||
TAG: ${{ fromJson(needs.release.outputs.releases)[format('{0}--tag_name', matrix.path)] }}
|
||||
VERSION: ${{ fromJson(needs.release.outputs.releases)[format('{0}--version', matrix.path)] }}
|
||||
RELEASE_ID: ${{ fromJson(needs.release.outputs.releases)[format('{0}--id', matrix.path)] }}
|
||||
|
||||
steps:
|
||||
- name: Debug
|
||||
@@ -112,27 +117,25 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: gh release upload "$TAG" .cr-release-packages/*.tgz --clobber
|
||||
|
||||
- name: Update index
|
||||
run: |
|
||||
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
|
||||
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
|
||||
|
||||
# Create docs directory and copy chart
|
||||
mkdir -p docs
|
||||
cp .cr-release-packages/*.tgz docs/ || true
|
||||
|
||||
# Generate index.yaml for GitHub Pages
|
||||
args=(-o "$owner" -r "$repo" -c "https://henrygd.github.io/beszel" --push -t "${{ secrets.CR_TOKEN }}" --index-path docs/index.yaml)
|
||||
.tmp/cr index "${args[@]}"
|
||||
|
||||
- name: Publish chart release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CHART_PATH: ${{ matrix.path }}
|
||||
run: |
|
||||
chart_name="${CHART_PATH##*/}"
|
||||
release_id=$(gh api "repos/${GITHUB_REPOSITORY}/releases/tags/${TAG}" --jq .id)
|
||||
gh api --method PATCH "repos/${GITHUB_REPOSITORY}/releases/${release_id}" \
|
||||
gh api --method PATCH "repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}" \
|
||||
-f "name=Helm chart: ${chart_name} v${VERSION}" \
|
||||
-F draft=false \
|
||||
-f make_latest=false
|
||||
|
||||
- name: Update index
|
||||
run: |
|
||||
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
|
||||
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
|
||||
|
||||
# Create the local output directory for the generated index
|
||||
mkdir -p docs
|
||||
|
||||
# Generate index.yaml for GitHub Pages
|
||||
args=(-o "$owner" -r "$repo" --push -t "${{ secrets.CR_TOKEN }}" --index-path docs/index.yaml --release-name-template '{{ .Name }}-v{{ .Version }}')
|
||||
.tmp/cr index "${args[@]}"
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Installs beszel-agent in kubernetes
|
||||
home: https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-agent
|
||||
name: beszel-agent
|
||||
appVersion: "0.17.0"
|
||||
# This version is managed automatically by Release Please.
|
||||
# Managed automatically by Release Please; do not edit manually.
|
||||
version: 0.1.2
|
||||
sources:
|
||||
- https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-agent
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Installs beszel-hub in kubernetes
|
||||
home: https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-hub
|
||||
name: beszel-hub
|
||||
appVersion: "0.17.0"
|
||||
# This version is managed automatically by Release Please.
|
||||
# Managed automatically by Release Please; do not edit manually.
|
||||
version: 0.1.2
|
||||
sources:
|
||||
- https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-hub
|
||||
|
||||
Reference in New Issue
Block a user