Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
name: Release

# Builder for the vCluster release pipeline (DEVOPS-1050). The GitHub Release is
# a pipeline OUTPUT, not a trigger: goreleaser creates it at the end of a green
# build. This workflow is dispatched by the loft-sh/github-actions
# vcluster-release action via `gh workflow run release.yaml --ref <tag>`, so
# github.ref is refs/tags/<version> and github.ref_name is the version. It no
# longer triggers on release:created, so a monorepo-created OSS release can never
# re-trigger this builder.
on:
release:
types: [created]
workflow_dispatch:

jobs:
check_minimum_version_tag:
if: github.repository_owner == 'loft-sh'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
if: ${{ !contains(github.event.release.tag_name, '-') }}
if: ${{ !contains(github.ref_name, '-') }}
with:
ref: ${{ github.event.release.tag_name }}
ref: ${{ github.ref_name }}
- name: Validate MinimumVersionTag is stable
if: ${{ !contains(github.event.release.tag_name, '-') }}
if: ${{ !contains(github.ref_name, '-') }}
run: |
MINIMUM_VERSION_TAG=$(grep -oP 'MinimumVersionTag\s*=\s*"\Kv[^"]+' pkg/platform/version.go)
if [[ ! "$MINIMUM_VERSION_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
Expand Down Expand Up @@ -72,7 +78,10 @@ jobs:
run: |
RELEASE_VERSION=$(echo "$GITHUB_REF" | sed -nE 's!refs/tags/!!p')
echo "release_version=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
echo "previous_tag=$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)")" >> "$GITHUB_OUTPUT"
# Branch-local previous tag: the tag reachable from this commit's
# parent on THIS branch, not the global latest tag (which would be
# wrong on a release branch). See DEVOPS-1050.
echo "previous_tag=$(git describe --tags --abbrev=0 --match 'v*' "${GITHUB_SHA}^" 2>/dev/null || true)" >> "$GITHUB_OUTPUT"
- name: Validate semver
id: semver
uses: loft-sh/github-actions/.github/actions/semver-validation@semver-validation/v1
Expand Down Expand Up @@ -239,7 +248,7 @@ jobs:
contents: read
uses: loft-sh/github-actions/.github/workflows/notify-release.yaml@release-notification/v2
with:
release_version: ${{ github.event.release.tag_name }}
release_version: ${{ github.ref_name }}
target_repo: ${{ github.repository }}
product: vCluster
status: failure
Expand Down
Loading