diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9099244..14c2b4e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,3 @@ - name: Javascript Wrapper Release on: @@ -50,8 +49,11 @@ jobs: release: runs-on: ubuntu-latest env: - GITHUB_TOKEN: ${{ secrets.OR_GITHUB_TOKEN }} - BRANCH_NAME: npm-version-patch + GITHUB_TOKEN: ${{ secrets.OR_GITHUB_TOKEN }} + BRANCH_NAME: npm-version-patch + outputs: + TAG_NAME: ${{ steps.set_tag_name.outputs.TAG_NAME }} + CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }} steps: # CHECKOUT PROJECT @@ -73,12 +75,15 @@ jobs: # GET TAG NAME - name: Generate Tag name + id: set_tag_name run: | if [ ${{ inputs.dev }} == true ]; then - echo "TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version)" >> $GITHUB_ENV + TAG_NAME=$(npm version prerelease --preid=${{ inputs.jsTag }} --no-git-tag-version --allow-same-version) else - echo "TAG_NAME=$(npm version patch --no-git-tag-version)" >> $GITHUB_ENV + TAG_NAME=$(npm version patch --no-git-tag-version) fi + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV + echo "::set-output name=TAG_NAME::$TAG_NAME" # DOWNLOAD CLI IF IT IS A DEV VERSION AND A CLI TAG WAS PROVIDED - name: Download cli with tag ${{ inputs.cliTag }} @@ -88,6 +93,14 @@ jobs: chmod +x ./.github/scripts/update_cli.sh ./.github/scripts/update_cli.sh ${{ inputs.cliTag }} + - name: Extract CLI version + id: extract_cli_version + run: | + CLI_VERSION=$(./src/main/wrapper/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" + # RUN NPM INSTALL AND BUILD - name: NPM ci and build run: | @@ -151,3 +164,16 @@ jobs: tag_name: ${{env.TAG_NAME}} generate_release_notes: true prerelease: ${{ inputs.dev }} + + notify: + if: inputs.dev == false + needs: release + uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main + with: + product_name: Javascript 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-javascript-wrapper/releases/tag/${{ needs.release.outputs.TAG_NAME }} + jira_product_name: JAVASCRIPT_WRAPPER + secrets: inherit