From 68935cf9773beb75e808e151e890cd0f677486ab Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Thu, 12 Dec 2024 21:22:01 +0000 Subject: [PATCH 1/2] Trigger release actions if tag matches new `-rc.X` prerelease tags Since we now plan to give release candidates tags suffixed with `-rc.X`, where X indicates the release candidate number, we also need to run the release actions for these tags. The release.yaml action generates artifacts for our github repo and marks things as a pre-release, so we definitely want it to trigger on release candidate tags. The build-prod-container.yaml action creates our containers, and since these are used by integrations to test release candidates, we also need those too. It looks like the triggers for dev container builds will already match against release candidate tags (if I can mentally parse the regex) so we should be fine there. --- .github/workflows/build-prod-container.yml | 2 ++ .github/workflows/release.yml | 3 +++ .goreleaser.yml | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build-prod-container.yml b/.github/workflows/build-prod-container.yml index 3ce3c4dff..ac9997f17 100644 --- a/.github/workflows/build-prod-container.yml +++ b/.github/workflows/build-prod-container.yml @@ -8,7 +8,9 @@ on: tags: # only run release on v7.0.0 and up - v[7-9]\.[0-9]+\.[0-9]+ + - v[7-9]\.[0-9]+\.[0-9]+-rc\.[0-9]+ - v[1-9][0-9]+\.[0-9]+\.[0-9]+ + - v[1-9][0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+ repository_dispatch: types: - dispatch-build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95e8b09aa..fda8a9201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,11 @@ on: push: tags: # only run release on v7.0.0 and up + # Match against v7.0.0, v7.0.0-rc.1, v7.0.0-rc.2, etc. - v[7-9]\.[0-9]+\.[0-9]+ + - v[7-9]\.[0-9]+\.[0-9]+-rc\.[0-9]+ - v[1-9][0-9]+\.[0-9]+\.[0-9]+ + - v[1-9][0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+ permissions: contents: write diff --git a/.goreleaser.yml b/.goreleaser.yml index 5ae8b446f..142353f3a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -109,6 +109,10 @@ nfpms: - package_name: pelican builds: - pelican + # Note that git tags like v7.0.0-rc.1 will be modified by goreleaser when building + # rpms to be v7.0.0~rc.1-1. The tilde is a special character in RPM versioning that + # signifies some version substring should be sorted as less than the rest of the version, + # so that v7.0.0~rc.1-1 < v7.0.0-1. file_name_template: "{{ .ConventionalFileName }}" id: pelican vendor: OSG Consortium From b5da25c14937635229585d9881299a3cad6c7093 Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Wed, 18 Dec 2024 17:50:41 +0000 Subject: [PATCH 2/2] Don't use -rc.X tags for creating 'latest' container images --- .github/workflows/build-prod-container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-prod-container.yml b/.github/workflows/build-prod-container.yml index ac9997f17..0a5138e84 100644 --- a/.github/workflows/build-prod-container.yml +++ b/.github/workflows/build-prod-container.yml @@ -94,7 +94,7 @@ jobs: id: latest_version run: | git fetch --tags - tags=$(git tag -l 'v*.*.*' | sort -V) + tags=$(git tag -l 'v*.*.*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V) highest_tag=$(echo "${tags}" | tail -n1) echo "Highest version tag is ${highest_tag}" if [[ "${GITHUB_REF##*/}" == "${highest_tag}" ]]; then