From 8d174e147cd15b6d51ccbbc88bf95779661dfc18 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Thu, 5 Dec 2024 17:37:30 +0100 Subject: [PATCH] Fix and future-proof the CI release scripts (#21810) - Forward-ports changes to `publish_release` CI job from `release-3.6.1` branch. * Fix building SDK archives, don't use `build-sdk-packages` job that produced artifacts in SNAPSHOT version * Fix typos introduced in template (forward port from `release-3.6.0`) - Detect and check version used to publish artifacts: * For release builds ensure that `version` is always matching tag used to trigger CI job * For nightly builds ensure that `version` is following the expected pattern [Cherry-picked 34f1c546b968f2d14443e48e268a93c3f19923d1][modified] --- .github/workflows/ci.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec35d7f2542c..09894b272f22 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -580,6 +580,13 @@ jobs: echo "This build version: $ver" echo "THISBUILD_VERSION=$ver" >> $GITHUB_ENV + - name: Check is version matching pattern + run: | + if ! grep -Eo "3\.[0-9]+\.[0-9]+-RC[0-9]+-bin-[0-9]{8}-[a-zA-Z0-9]{7}-NIGHTLY" <<< "${{ env.THISBUILD_VERSION }}"; then + echo "Version used by compiler to publish nightly release does not match expected pattern" + exit 1 + fi + - name: Check whether not yet published id: not_yet_published continue-on-error: true @@ -685,6 +692,16 @@ jobs: - name: Add SBT proxy repositories run: cp -vf .github/workflows/repositories /root/.sbt/ ; true + - name: Check compiler version + shell: bash + run : | + version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1) + echo "This build version: ${version}" + if [ "${version}" != "${{ env.RELEASE_TAG }}" ]; then + echo "Compiler version for this build '${version}', does not match tag: ${{ env.RELEASE_TAG }}" + exit 1 + fi + - name: Prepare Release run: | ./project/scripts/sbt dist/packArchive