@@ -31,27 +31,37 @@ jobs:
3131 if : inputs.rbranch
3232 release :
3333 runs-on : ubuntu-latest
34+ outputs :
35+ TAG_NAME : ${{ steps.generate_tag_name.outputs.TAG_NAME }}
36+ CLI_VERSION : ${{ steps.set_outputs.outputs.CLI_VERSION }}
3437 steps :
3538 - name : Checkout
3639 uses : actions/checkout@v3.5.2
3740 with :
3841 token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3942
40- # Set the tag in an env var
41- - name : Set env
42- run : |
43- echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
4443 - name : Create Release Name
44+ id : generate_tag_name
4545 run : |
4646 echo "Creating release name"
47+
4748 if [ -z "${{ inputs.rbranch }}" ]; then
48- echo " GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
49- echo " GH_BRANCH_NAME=main" >> $GITHUB_ENV
49+ export GH_RELEASE_TAG_NAME=" ${{ inputs.tag }}"
50+ export GH_BRANCH_NAME=" main"
5051 else
51- echo " GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}-${{ inputs.rbranch }}" >> $GITHUB_ENV
52- echo " GH_BRANCH_NAME=nightly" >> $GITHUB_ENV
52+ export GH_RELEASE_TAG_NAME=" ${{ inputs.tag }}-${{ inputs.rbranch }}"
53+ export GH_BRANCH_NAME=" nightly"
5354 fi
54-
55+
56+ echo "Generated TAG_NAME: $GH_RELEASE_TAG_NAME"
57+
58+ # Persist the variables
59+ echo "GH_RELEASE_TAG_NAME=$GH_RELEASE_TAG_NAME" >> $GITHUB_ENV
60+ echo "GH_BRANCH_NAME=$GH_BRANCH_NAME" >> $GITHUB_ENV
61+
62+ # Set outputs for future steps
63+ echo "TAG_NAME=$GH_RELEASE_TAG_NAME" >> $GITHUB_OUTPUT
64+
5565 - name : Set up JDK 8
5666 uses : actions/setup-java@v3
5767 with :
@@ -67,13 +77,24 @@ jobs:
6777 ${{ runner.os }}-maven-
6878
6979 - name : Update the POM version.
70- run : mvn -B org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml
80+ run : mvn -B org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion='${{ inputs.tag }}' --file pom.xml
7181
7282 - name : Create release
7383 run : mvn -B clean install --file pom.xml -DskipTests -pl "!checkmarx-ast-eclipse-plugin-tests"
7484
85+ - name : Extract CLI version
86+ id : extract_cli_version
87+ run : |
88+ chmod +x ./.github/scripts/extract_cli_version.sh
89+ ./.github/scripts/extract_cli_version.sh cx-linux
90+
91+ - name : Echo CLI version to outputs
92+ id : set_outputs
93+ run : |
94+ echo "::set-output name=CLI_VERSION::${{ env.CLI_VERSION }}"
95+
7596 - name : Release
76- uses : softprops/action-gh-release@v1
97+ uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
7798 with :
7899 tag_name : ${{ env.GH_RELEASE_TAG_NAME }}
79100 generate_release_notes : true
87108 git config --global https.postBuffer 2097152000
88109
89110 - name : Create update site
90- uses : cpina/github-action-push-to-another-repository@main
111+ uses : cpina/github-action-push-to-another-repository@07c4d7b3def0a8ebe788a8f2c843a4e1de4f6900 # v.1.7.2
91112 env :
92113 API_TOKEN_GITHUB : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
93114 with :
@@ -97,3 +118,16 @@ jobs:
97118 destination-repository-name : ' ast-eclipse-plugin-update-site'
98119 user-email : cylon-bot@checkmarx.com
99120 target-branch : ${{ env.GH_BRANCH_NAME }}
121+
122+ notify :
123+ if : ${{ inputs.rbranch == '' || inputs.rbranch == null }}
124+ needs : release
125+ uses : Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main
126+ with :
127+ product_name : Eclipse
128+ release_version : ${{ needs.release.outputs.TAG_NAME }}
129+ cli_release_version : ${{ needs.release.outputs.CLI_VERSION }}
130+ release_author : " Phoenix Team"
131+ release_url : https://github.com/Checkmarx/ast-eclipse-plugin/releases/tag/${{ needs.release.outputs.TAG_NAME }}
132+ jira_product_name : ECLIPSE
133+ secrets : inherit
0 commit comments