This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/grails-intellij-plugin.git
commit bcb449d9d472a3dd0368181475d6383af6adf22c Author: James Daugherty <[email protected]> AuthorDate: Sat Jul 18 16:55:51 2026 -0400 Restore releaseDistributions.sh for post-vote promotion --- .github/scripts/releaseDistributions.sh | 90 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 22 ++------ 2 files changed, 94 insertions(+), 18 deletions(-) diff --git a/.github/scripts/releaseDistributions.sh b/.github/scripts/releaseDistributions.sh new file mode 100755 index 0000000..eef4ffa --- /dev/null +++ b/.github/scripts/releaseDistributions.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# ./releaseDistributions.sh <tag> <svn-folder> <username> + +set -euo pipefail + +if [[ $# -ne 3 ]]; then + echo "Usage: $0 <tag> <svn-folder> <username>" >&2 + exit 1 +fi + +RELEASE_TAG="$1" +SVN_FOLDER="$2" +SVN_USER="$3" +read -r -s -p "Password: " SVN_PASS +echo + +if [[ -z "${RELEASE_TAG}" ]]; then + echo "❌ ERROR: Release Tag must not be empty." >&2 + exit 1 +fi +if [[ -z "${SVN_USER}" ]]; then + echo "❌ ERROR: Username must not be empty." >&2 + exit 1 +fi +if [[ -z "${SVN_PASS}" ]]; then + echo "❌ ERROR: Password must not be empty." >&2 + exit 1 +fi + +RELEASE_VERSION="${RELEASE_TAG#v}" +RELEASE_ROOT="https://dist.apache.org/repos/dist/release/grails/${SVN_FOLDER}" +DEV_ROOT="https://dist.apache.org/repos/dist/dev/grails/${SVN_FOLDER}" + +svn_flags=(--non-interactive --trust-server-cert --username "${SVN_USER}" --password "${SVN_PASS}") + +svn_exists() { + local url="$1" + svn ls "${svn_flags[@]}" --depth=empty "${url}" >/dev/null 2>&1 +} + +for folder in $(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}"); do + folder=$(echo "$folder" | sed 's|/$||') + [[ "${folder}" == "${RELEASE_VERSION}" ]] && continue + PRIOR_RELEASE_URL="${RELEASE_ROOT}/${folder}" + read -r -p "Remove old release folder '${folder}' at ${PRIOR_RELEASE_URL}? [y/N] " confirm < /dev/tty + if [[ "${confirm}" =~ ^[Yy](es)?$ ]]; then + echo "🗑️ Deleting old release folder: ${PRIOR_RELEASE_URL}" + svn rm "${svn_flags[@]}" -m "Remove previous release ${folder}" "${PRIOR_RELEASE_URL}" + echo "✅ Deleted old release folder" + else + echo "⏭️ Skipping removal of old release folder: ${PRIOR_RELEASE_URL}" + fi +done + +DEV_VERSION_URL="$DEV_ROOT/${RELEASE_VERSION}" +RELEASE_VERSION_URL="$RELEASE_ROOT/${RELEASE_VERSION}" + +if ! svn_exists "${DEV_VERSION_URL}"; then + echo "❌ ERROR: dev folder for ${RELEASE_VERSION} does not exist at: ${DEV_VERSION_URL}" >&2 + exit 2 +fi + +if svn_exists "${RELEASE_VERSION_URL}"; then + echo "❌ ERROR: release folder for ${RELEASE_VERSION} already exists at: ${RELEASE_VERSION_URL}" >&2 + exit 3 +fi + +echo "🚀 Promoting ${DEV_VERSION_URL} -> ${RELEASE_VERSION_URL}" +svn mv "${svn_flags[@]}" -m "Promote Apache Grails ${RELEASE_VERSION} from dev to release" "${DEV_VERSION_URL}" "${RELEASE_VERSION_URL}" +echo "✅ Promoted" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4302dc..aad4e66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -212,9 +212,6 @@ jobs: name: "VOTE SUCCEEDED - Publish Release" needs: [ publish, source, upload ] runs-on: ubuntu-latest - env: - SVN_USERNAME: ${{ secrets.SVC_DIST_GRAILS_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVC_DIST_GRAILS_PASSWORD }} steps: - name: "📝 Establish release version" run: echo "VERSION=${TAG#v}" >> "$GITHUB_ENV" @@ -223,22 +220,11 @@ jobs: echo "::group::Manual Confirmation" echo "🔎 Make sure that the vote confirmation on [email protected] completed successfully before proceeding." echo "::endgroup::" - - name: "🛠️ Install tools" - run: sudo apt-get install -y subversion - - name: "🚀 Promote distributions dev -> release" + - name: "🚀 MANUAL - Release distribution artifacts" run: | - set -e - if svn ls https://dist.apache.org/repos/dist/release/${SVN_PROJECT}/${SVN_FOLDER} --username "${SVN_USERNAME}" --password "${SVN_PASSWORD}" --non-interactive; then - echo "Release folder exists" - else - svnmucc --username "${SVN_USERNAME}" --password "${SVN_PASSWORD}" --non-interactive \ - mkdir https://dist.apache.org/repos/dist/release/${SVN_PROJECT}/${SVN_FOLDER} \ - -m "Create '${SVN_PROJECT}/${SVN_FOLDER}' release folder" - fi - svnmucc --username "${SVN_USERNAME}" --password "${SVN_PASSWORD}" --non-interactive \ - mv https://dist.apache.org/repos/dist/dev/${SVN_PROJECT}/${SVN_FOLDER}/${VERSION} \ - https://dist.apache.org/repos/dist/release/${SVN_PROJECT}/${SVN_FOLDER}/${VERSION} \ - -m "Release ${PROJECT_NAME} ${VERSION}" + echo "::group::Manual ASF Artifact Promotion" + echo "Run .github/scripts/releaseDistributions.sh ${TAG} ${SVN_FOLDER} <ASF_USER>" + echo "::endgroup::" - name: "📥 Checkout repository" uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with:
