Version chart releases from Git tags
This commit is contained in:
+11
-10
@@ -14,8 +14,10 @@ jobs:
|
||||
name: Validate chart
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source
|
||||
- name: Check out source and tags
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v4
|
||||
@@ -50,8 +52,10 @@ jobs:
|
||||
needs: validate
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source
|
||||
- name: Check out source and tags
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v4
|
||||
@@ -61,10 +65,7 @@ jobs:
|
||||
- name: Select immutable chart version
|
||||
run: |
|
||||
set -euo pipefail
|
||||
run_attempt="${GITHUB_RUN_ATTEMPT:-1}"
|
||||
test -n "${GITHUB_RUN_NUMBER}"
|
||||
printf 'CHART_VERSION=0.%s.%s\n' \
|
||||
"${GITHUB_RUN_NUMBER}" "${run_attempt}" >> "${GITHUB_ENV}"
|
||||
printf 'CHART_VERSION=%s\n' "$(./scripts/chart-version.sh)" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Package and publish chart
|
||||
env:
|
||||
@@ -113,10 +114,10 @@ jobs:
|
||||
working-directory: homelab-gitops
|
||||
run: |
|
||||
set -euo pipefail
|
||||
./scripts/update-immichframe-chart.sh "${CHART_VERSION}"
|
||||
git config user.name "immichframe chart CI"
|
||||
git config user.email "immichframe-chart-ci@brunner.ninja"
|
||||
git add apps/immichframe/Chart.yaml
|
||||
./scripts/update-chart-version.sh immichframe "${CHART_VERSION}"
|
||||
git config user.name "feedc0de"
|
||||
git config user.email "feedc0de@users.noreply.code.brunner.ninja"
|
||||
git add bootstrap/immichframe.yaml
|
||||
if git diff --cached --quiet; then
|
||||
echo "GitOps already selects ${CHART_VERSION}"
|
||||
exit 0
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
description=$(git describe --tags --long --match 'v[0-9]*' --dirty)
|
||||
case "$description" in
|
||||
*-dirty) echo "refusing to package a dirty tree" >&2; exit 1 ;;
|
||||
esac
|
||||
version=${description#v}
|
||||
case "$version" in
|
||||
*-0-g*) version=${version%%-0-g*} ;;
|
||||
esac
|
||||
printf '%s\n' "$version"
|
||||
Reference in New Issue
Block a user