mirror of
https://github.com/henrygd/beszel.git
synced 2026-08-18 00:07:47 +02: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:
33
.github/workflows/release-please.yml
vendored
33
.github/workflows/release-please.yml
vendored
@@ -18,6 +18,10 @@ env:
|
|||||||
|
|
||||||
name: helm-release
|
name: helm-release
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: helm-release
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
@@ -73,6 +77,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TAG: ${{ fromJson(needs.release.outputs.releases)[format('{0}--tag_name', matrix.path)] }}
|
TAG: ${{ fromJson(needs.release.outputs.releases)[format('{0}--tag_name', matrix.path)] }}
|
||||||
VERSION: ${{ fromJson(needs.release.outputs.releases)[format('{0}--version', 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:
|
steps:
|
||||||
- name: Debug
|
- name: Debug
|
||||||
@@ -112,27 +117,25 @@ jobs:
|
|||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: gh release upload "$TAG" .cr-release-packages/*.tgz --clobber
|
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
|
- name: Publish chart release
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CHART_PATH: ${{ matrix.path }}
|
CHART_PATH: ${{ matrix.path }}
|
||||||
run: |
|
run: |
|
||||||
chart_name="${CHART_PATH##*/}"
|
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 "name=Helm chart: ${chart_name} v${VERSION}" \
|
||||||
-F draft=false \
|
-F draft=false \
|
||||||
-f make_latest=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
|
home: https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-agent
|
||||||
name: beszel-agent
|
name: beszel-agent
|
||||||
appVersion: "0.17.0"
|
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
|
version: 0.1.2
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-agent
|
- 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
|
home: https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-hub
|
||||||
name: beszel-hub
|
name: beszel-hub
|
||||||
appVersion: "0.17.0"
|
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
|
version: 0.1.2
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-hub
|
- https://github.com/henrygd/beszel/tree/main/supplemental/helm/beszel-hub
|
||||||
|
|||||||
Reference in New Issue
Block a user