diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 82c95238391..f8252eaab8d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -31,7 +31,6 @@ on: env: GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }} - IS_WORKFLOW_STOPPED: false jobs: generate_release_note: @@ -178,37 +177,34 @@ jobs: }) if (data.name == '${{ steps.get-version.outputs.release-branch-name }}') { + echo "Release branch ${{ steps.get-version.outputs.release-branch-name }} already exists." return 'true' } else { + echo "Release branch ${{ steps.get-version.outputs.release-branch-name }} does not exist." return 'false' } - - name: Stop workflow if release branch exists and the event is a push to main - if: steps.release-branch-exists == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push' - run: | - echo "Release branch ${{ steps.get-version.outputs.release-branch-name }} already exists. Stop the workflow." - echo "IS_WORKFLOW_STOPPED=true" >> $GITHUB_ENV - name: Generate release summary - if: env.IS_WORKFLOW_STOPPED == 'false' + if: steps.release-branch-exists.outputs.result == 'false' run: | echo "## Release" >> $GITHUB_STEP_SUMMARY echo "* Release driver: $GITHUB_ACTOR ">> $GITHUB_STEP_SUMMARY echo "* Supported versions: ${{ steps.get-supported-versions.outputs.result }}" >> $GITHUB_STEP_SUMMARY echo "* Desired release tag: ${{ steps.get-version.outputs.release-version }}" >> $GITHUB_STEP_SUMMARY echo "* Desired release branch: ${{ steps.get-version.outputs.release-branch-name }}" >> $GITHUB_STEP_SUMMARY - echo "* Release date: $(date)" >> $GITHUB_STEP_SUMMARY + echo "* Release date: $(date)" >> $GITHUB_STEP_SUMMA`RY - name: Release radius-project/radius version ${{ steps.get-version.outputs.release-version }} - if: success() && env.IS_WORKFLOW_STOPPED == 'false' + if: success() && steps.release-branch-exists.outputs.result == 'false' run: | ./radius/.github/scripts/release-create-tag-and-branch.sh radius ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} - name: Release radius-project/bicep version ${{ steps.get-version.outputs.release-version }} - if: success() && env.IS_WORKFLOW_STOPPED == 'false' + if: success() && steps.release-branch-exists.outputs.result == 'false' run: | ./radius/.github/scripts/release-create-tag-and-branch.sh bicep ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} - name: Release radius-project/deployment-engine version ${{ steps.get-version.outputs.release-version }} - if: success() && env.IS_WORKFLOW_STOPPED == 'false' + if: success() && steps.release-branch-exists.outputs.result == 'false' run: | ./radius/.github/scripts/release-create-tag-and-branch.sh deployment-engine ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} - name: Release radius-project/recipes version ${{ steps.get-version.outputs.release-version }} - if: success() && env.IS_WORKFLOW_STOPPED == 'false' + if: success() && steps.release-branch-exists.outputs.result == 'false' run: | ./radius/.github/scripts/release-create-tag-and-branch.sh recipes ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }}