From 02bd0d4f684c9d25784d016a087f1ee0a629f9c5 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:07:14 +0200 Subject: [PATCH 1/8] Add notify step to release.yml (AST-000) --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17f35b0c..3c78c513 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,9 @@ on: jobs: release: runs-on: ubuntu-latest + outputs: + TAG_NAME: ${{ steps.set_tag_name.outputs.TAG_NAME }} + CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }} steps: - name: Checkout uses: actions/checkout@v4 @@ -49,6 +52,7 @@ jobs: ./.github/scripts/update_cli.sh ${{ inputs.cliTag }} - name: Tag + id: set_tag_name run: | echo ${{ inputs.tag }} tag=${{ inputs.tag }} @@ -58,6 +62,7 @@ jobs: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git tag -a "${tag}" -m "${message}" git push origin "${tag}" + echo "::set-output name=TAG_NAME::${tag}" - name: Cache local Maven repository uses: actions/cache@v4 @@ -77,9 +82,7 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Update the POM version. run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests @@ -91,6 +94,14 @@ jobs: fi echo "AID_PROP=${prop}" >> $GITHUB_ENV + - name: Extract CLI version + id: extract_cli_version + run: | + CLI_VERSION=$(./src/main/resources/cx-linux version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+') + echo "CLI version being packed is $CLI_VERSION" + echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV + echo "::set-output name=CLI_VERSION::$CLI_VERSION" + - name: Publish package run: mvn --batch-mode deploy -DskipTests ${{ env.AID_PROP }} env: @@ -104,3 +115,16 @@ jobs: generate_release_notes: true tag_name: ${{ inputs.tag }} prerelease: ${{ inputs.dev }} + + notify: + if: inputs.dev == false || input.tag == 'test-notify' + needs: release + uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main + with: + product_name: Java Wrapper + release_version: ${{ needs.release.outputs.TAG_NAME }} + cli_release_version: ${{ needs.release.outputs.CLI_VERSION }} + release_author: "Phoenix Team" + release_url: https://github.com/CheckmarxDev/ast-cli-java-wrapper/releases/tag/${{ needs.release.outputs.TAG_NAME }} + jira_product_name: JAVA_WRAPPER + secrets: inherit \ No newline at end of file From 7b83ab297dc43cde5a68dc6e55fc1e0bf8b1534e Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:10:18 +0200 Subject: [PATCH 2/8] fix input to inputs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c78c513..5b705a3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,7 +117,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || input.tag == 'test-notify' + if: inputs.dev == false || inputs.tag == 'test-notify' needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: From 0ba5b97f04bb1de1857a062adbe2976f0729ed24 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:17:16 +0200 Subject: [PATCH 3/8] fix input to inputs --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b705a3d..9ff7d2fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,6 @@ jobs: release: runs-on: ubuntu-latest outputs: - TAG_NAME: ${{ steps.set_tag_name.outputs.TAG_NAME }} CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }} steps: - name: Checkout @@ -62,7 +61,7 @@ jobs: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git tag -a "${tag}" -m "${message}" git push origin "${tag}" - echo "::set-output name=TAG_NAME::${tag}" + echo "::set-output name=TAG_NAME::${env.RELEASE_VERSION}" - name: Cache local Maven repository uses: actions/cache@v4 From 60a9a7580e9a92d9cf6190a41e7391ea533c17e2 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:22:53 +0200 Subject: [PATCH 4/8] fix input to inputs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ff7d2fd..236c0232 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,7 +116,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || inputs.tag == 'test-notify' + if: inputs.dev == false || inputs.tag == 'test-notify1' needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: From 697d54bb345e8b2638efe07dc00d507db9e447a7 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:23:50 +0200 Subject: [PATCH 5/8] fix input to inputs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 236c0232..6bdb7101 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,7 +116,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || inputs.tag == 'test-notify1' + if: inputs.dev == false || inputs.tag == 'test-notifyy' needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: From b5f8bb80821b9b5d4c790d597c4476f6d1ed0074 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:25:50 +0200 Subject: [PATCH 6/8] fix input to inputs --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6bdb7101..3dea618a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,7 @@ jobs: runs-on: ubuntu-latest outputs: CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }} + TAG_NAME: ${{ steps.set_tag_name.outputs.TAG_NAME }} steps: - name: Checkout uses: actions/checkout@v4 From d2145a217da1b0d2595bd37f4c5f99c509ff4352 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:27:40 +0200 Subject: [PATCH 7/8] fix input to inputs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3dea618a..82b8196a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git tag -a "${tag}" -m "${message}" git push origin "${tag}" - echo "::set-output name=TAG_NAME::${env.RELEASE_VERSION}" + echo "::set-output name=TAG_NAME::${{ inputs.tag }}" - name: Cache local Maven repository uses: actions/cache@v4 From 7b6f2e867d963cf2eba4722e43781ac822426428 Mon Sep 17 00:00:00 2001 From: AlvoBen Date: Wed, 29 Jan 2025 11:33:57 +0200 Subject: [PATCH 8/8] change if condition to notify job --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82b8196a..70882f4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,7 +117,7 @@ jobs: prerelease: ${{ inputs.dev }} notify: - if: inputs.dev == false || inputs.tag == 'test-notifyy' + if: inputs.dev == false needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: