diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad11d6740..57f59ceff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,8 +108,8 @@ jobs: - name: prepare Maven release run: scripts/release-prepare.sh env: - RELEASE_BRANCH_NAME: "main" - PRERELEASE_BRANCH_PATTERN: "-rc" + RELEASE_BRANCH_PATTERN: "release" + PRERELEASE_BRANCH_PATTERN: "main" GIT_RELEASE_BOT_NAME: "nb-droid" GIT_RELEASE_BOT_EMAIL: ${{ secrets.GIT_RELEASE_BOT_EMAIL }} ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }} diff --git a/scripts/release-perform.sh b/scripts/release-perform.sh index 2ae4aae49..c21914fd5 100755 --- a/scripts/release-perform.sh +++ b/scripts/release-perform.sh @@ -22,8 +22,9 @@ fi PRERELEASE_BRANCH_PATTERN=${PRERELEASE_BRANCH_PATTERN:?PRERELEASE_BRANCH_PATTERN must be provided} # Filter the branch to execute the release on readonly local current_branch=$(git rev-parse --abbrev-ref HEAD) + echo "Current branch: ${branch}" -if [[ -n "$RELEASE_BRANCH_NAME" && "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then +if [[ -n "${current_branch}" && "${current_branch}" == *"${RELEASE_BRANCH_PATTERN}"* ]]; then echo "Building for release branch $RELEASE_BRANCH_NAME" elif [[ -n "${current_branch}" && "${current_branch}" == *"${PRERELEASE_BRANCH_PATTERN}"* ]]; then echo "Building prerelease for branch $RELEASE_BRANCH_NAME" diff --git a/scripts/release-prepare.sh b/scripts/release-prepare.sh index ea84d7ea8..58f5fbde9 100755 --- a/scripts/release-prepare.sh +++ b/scripts/release-prepare.sh @@ -13,7 +13,8 @@ PRERELEASE_BRANCH_PATTERN=${PRERELEASE_BRANCH_PATTERN:?PRERELEASE_BRANCH_PATTERN # Filter the branch to execute the release on readonly local current_branch=$(git rev-parse --abbrev-ref HEAD) echo "Current branch: ${current_branch}" -if [[ -n "$RELEASE_BRANCH_NAME" && "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then + +if [[ -n "${current_branch}" && "${current_branch}" == *"${RELEASE_BRANCH_PATTERN}"* ]]; then echo "Building for release branch $RELEASE_BRANCH_NAME" elif [[ -n "${current_branch}" && "${current_branch}" == *"${PRERELEASE_BRANCH_PATTERN}"* ]]; then echo "Building prerelease for branch $RELEASE_BRANCH_NAME"