diff --git a/.github/scripts/generateChangelog.sh b/.github/scripts/generateChangelog.sh new file mode 100644 index 00000000..581ddecc --- /dev/null +++ b/.github/scripts/generateChangelog.sh @@ -0,0 +1,231 @@ +#!/usr/bin/env bash +set -euo pipefail + +# --------------------------------------------------------------------------- +# Generate changelog for a specific plugin using git log filtered by path. +# +# Mirrors the VS Code extension's generateChangelog.js for the JetBrains +# multi-plugin monorepo. +# +# Usage: +# ./generateChangelog.sh --plugin checkmarx --version 2.3.4 --repo Checkmarx/ast-jetbrains-plugin +# ./generateChangelog.sh --plugin devassist --version 1.0.0 --repo Checkmarx/ast-jetbrains-plugin +# +# Outputs: +# Structured release body section on stdout between RELEASE_BODY_START / RELEASE_BODY_END +# --------------------------------------------------------------------------- + +PLUGIN="" +VERSION="" +REPO="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --plugin) PLUGIN="$2"; shift 2 ;; + --version) VERSION="$2"; shift 2 ;; + --repo) REPO="$2"; shift 2 ;; + *) echo "Unknown arg: $1" >&2; exit 1 ;; + esac +done + +if [[ -z "$PLUGIN" || -z "$VERSION" || -z "$REPO" ]]; then + echo "Usage: $0 --plugin checkmarx|devassist --version X.Y.Z --repo owner/repo" >&2 + exit 1 +fi + +case "$PLUGIN" in + checkmarx) + DISPLAY_NAME="Checkmarx (AST)" + GIT_PATHS=("plugin-checkmarx-ast/" "common-lib/") + ;; + devassist) + DISPLAY_NAME="DevAssist" + GIT_PATHS=("plugin-checkmarx-devassist/" "devassist-lib/" "common-lib/") + ;; + *) + echo "--plugin must be 'checkmarx' or 'devassist'" >&2 + exit 1 + ;; +esac + +REPO_URL="https://github.com/${REPO}" + +# --------------------------------------------------------------------------- +# Find last stable tag (plain version tags like 2.3.3, no suffix) +# Tags follow the JetBrains convention: plain numbers, no v prefix +# --------------------------------------------------------------------------- +find_last_stable_tag() { + local all_tags + all_tags=$(git tag --sort=-creatordate 2>/dev/null || true) + + if [[ -z "$all_tags" ]]; then + echo "" + return + fi + + while IFS= read -r tag; do + # Match plain version tags (e.g. 2.3.3) -- no suffix like -nightly + if [[ "$tag" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "$tag" + return + fi + done <<< "$all_tags" + + # Fallback: check v-prefixed tags (legacy) + while IFS= read -r tag; do + if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "$tag" + return + fi + done <<< "$all_tags" + + echo "" +} + +LAST_TAG=$(find_last_stable_tag) +if [[ -n "$LAST_TAG" ]]; then + echo "Found last stable tag: $LAST_TAG" >&2 + RANGE="${LAST_TAG}..HEAD" +else + echo "No stable tag found, using full history" >&2 + RANGE="HEAD" +fi + +# --------------------------------------------------------------------------- +# Patterns to exclude (automation / version bump commits) +# --------------------------------------------------------------------------- +EXCLUDE_REGEX="(update.*version.*automated|bump version|\[create-pull-request\] automated|Merge pull request.*dependabot|^Merge branch)" + +# --------------------------------------------------------------------------- +# Collect commits filtered by subproject paths +# --------------------------------------------------------------------------- +RAW_LOG=$(git log ${RANGE} --pretty=format:"%H|||%s|||%an" -- "${GIT_PATHS[@]}" 2>/dev/null || true) + +# --------------------------------------------------------------------------- +# Categorize commits by conventional commit patterns +# --------------------------------------------------------------------------- +declare -a FEATURES=() +declare -a FIXES=() +declare -a DOCS=() +declare -a REFACTORS=() +declare -a PERFS=() +declare -a OTHERS=() + +if [[ -n "$RAW_LOG" ]]; then + while IFS= read -r line; do + HASH=$(echo "$line" | awk -F'\\|\\|\\|' '{print $1}') + MSG=$(echo "$line" | awk -F'\\|\\|\\|' '{print $2}') + AUTHOR_NAME=$(echo "$line" | awk -F'\\|\\|\\|' '{print $3}') + + # Strip leading whitespace, then leading "* " or "- " from squash/merge commit subjects + MSG=$(echo "$MSG" | sed 's/^[[:space:]]*//' | sed 's/^[*-][[:space:]]*//') + + [[ -z "$MSG" ]] && continue + + if echo "$MSG" | grep -qiE "$EXCLUDE_REGEX"; then + continue + fi + + GH_USER="$AUTHOR_NAME" + if command -v gh &>/dev/null && [[ -n "$HASH" ]]; then + RESOLVED=$(gh api "repos/${REPO}/commits/${HASH}" --template '{{.author.login}}' 2>/dev/null || true) + if [[ -n "$RESOLVED" && "$RESOLVED" != " " ]]; then + GH_USER="$RESOLVED" + else + GH_USER=$(echo "$AUTHOR_NAME" | tr -d ' ') + fi + fi + + ENTRY="- ${MSG} by @${GH_USER}" + MSG_LOWER=$(echo "$MSG" | tr '[:upper:]' '[:lower:]') + + if echo "$MSG" | grep -qE "^feat(\(.+\))?[:\!]" || echo "$MSG_LOWER" | grep -qiE "\b(add|added|adding|new feature|feature|implement|implemented)\b"; then + FEATURES+=("$ENTRY") + elif echo "$MSG" | grep -qE "^fix(\(.+\))?[:\!]" || echo "$MSG_LOWER" | grep -qiE "\b(fix|fixed|fixing|fixes|resolve|resolved|bug)\b"; then + FIXES+=("$ENTRY") + elif echo "$MSG" | grep -qE "^docs(\(.+\))?[:\!]" || echo "$MSG_LOWER" | grep -qiE "\b(doc|docs|documentation|readme)\b"; then + DOCS+=("$ENTRY") + elif echo "$MSG" | grep -qE "^refactor(\(.+\))?[:\!]" || echo "$MSG_LOWER" | grep -qiE "\b(refactor|refactoring|restructure|reorganize)\b"; then + REFACTORS+=("$ENTRY") + elif echo "$MSG" | grep -qE "^perf(\(.+\))?[:\!]" || echo "$MSG_LOWER" | grep -qiE "\b(perf|performance|optimize|optimized|optimization)\b"; then + PERFS+=("$ENTRY") + else + OTHERS+=("$ENTRY") + fi + done <<< "$RAW_LOG" +fi + +# --------------------------------------------------------------------------- +# Build the release body section (write line-by-line for clean markdown) +# --------------------------------------------------------------------------- +emit() { printf '%s\n' "$1"; } + +echo "RELEASE_BODY_START" + +emit "## ${DISPLAY_NAME}: ${VERSION}" +emit "" +emit "### What's Changed" +emit "" + +section_added=false + +if [[ ${#FEATURES[@]} -gt 0 ]]; then + emit "#### 🚀 New Features" + emit "" + for e in "${FEATURES[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ ${#FIXES[@]} -gt 0 ]]; then + emit "#### 🐛 Bug Fixes" + emit "" + for e in "${FIXES[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ ${#DOCS[@]} -gt 0 ]]; then + emit "#### 📝 Documentation" + emit "" + for e in "${DOCS[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ ${#REFACTORS[@]} -gt 0 ]]; then + emit "#### ♻️ Refactor" + emit "" + for e in "${REFACTORS[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ ${#PERFS[@]} -gt 0 ]]; then + emit "#### ⚡ Performance" + emit "" + for e in "${PERFS[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ ${#OTHERS[@]} -gt 0 ]]; then + emit "#### 🔧 Other Changes" + emit "" + for e in "${OTHERS[@]}"; do emit "$e"; done + emit "" + section_added=true +fi + +if [[ "$section_added" == "false" ]]; then + emit "_No changes_" + emit "" +fi + +if [[ -n "$LAST_TAG" ]]; then + emit "**Full Changelog**: ${REPO_URL}/compare/${LAST_TAG}...${VERSION}" +else + emit "**Full Changelog**: ${REPO_URL}/releases/tag/${VERSION}" +fi + +echo "RELEASE_BODY_END" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a8ba88e0..80525edf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,17 +10,26 @@ jobs: set_tag: runs-on: ubuntu-latest outputs: - tag_name: ${{ steps.tagname.outputs.tag_name }} + tag_version: ${{ steps.tagname.outputs.tag_version }} + ast_version: ${{ steps.tagname.outputs.ast_version }} + devassist_version: ${{ steps.tagname.outputs.devassist_version }} steps: - - name: Create tagname - run: echo "tag_name=2.0.$(date +%s)" >> "$GITHUB_OUTPUT" + - name: Create version id: tagname - - name: Print tagname - run: echo "created tag ${{ steps.tagname.outputs.tag_name }}" + run: | + TS=$(date +%s) + echo "tag_version=2.0.${TS}" >> "$GITHUB_OUTPUT" + echo "ast_version=2.0.${TS}" >> "$GITHUB_OUTPUT" + echo "devassist_version=1.0.${TS}" >> "$GITHUB_OUTPUT" + - name: Print version + run: echo "created version ${{ steps.tagname.outputs.tag_version }}" nightly: needs: set_tag uses: Checkmarx/ast-jetbrains-plugin/.github/workflows/release.yml@main with: - tag: ${{ needs.set_tag.outputs.tag_name }} + tag: ${{ needs.set_tag.outputs.tag_version }} + ast_version: ${{ needs.set_tag.outputs.ast_version }} + devassist_version: ${{ needs.set_tag.outputs.devassist_version }} + releaseType: "checkmarx" rchannels: "nightly" secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c53d345..71918d43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,20 @@ on: workflow_call: inputs: tag: - description: 'Next release tag' + description: 'Release tag (e.g. 2.3.4)' + required: true + type: string + releaseType: + description: 'Which plugin(s) to publish to marketplace (checkmarx | devAssist | both)' + required: false + type: string + default: 'both' + ast_version: + description: 'Version for checkmarx-ast-plugin zip (e.g. 2.0.1234567890)' + required: true + type: string + devassist_version: + description: 'Version for checkmarx-developer-assist-plugin zip (e.g. 1.0.1234567890)' required: true type: string javawrapperversion: @@ -15,10 +28,37 @@ on: description: 'Channels to publish development releases' required: false type: string + publish: + description: 'Publish to JetBrains Marketplace' + required: false + type: boolean + default: true + skip_tests: + description: 'Skip integration tests' + required: false + type: boolean + default: false workflow_dispatch: inputs: tag: - description: 'Next release tag' + description: 'Main release tag (e.g. 2.3.4)' + required: true + type: string + releaseType: + description: 'Which plugin(s) to publish to marketplace' + required: true + type: choice + options: + - both + - checkmarx + - devAssist + default: 'both' + ast_version: + description: 'Version for checkmarx-ast-plugin zip (e.g. 2.3.4)' + required: true + type: string + devassist_version: + description: 'Version for checkmarx-developer-assist-plugin zip (e.g. 1.0.0)' required: true type: string javawrapperversion: @@ -29,6 +69,21 @@ on: description: 'Channels to publish development releases' required: false type: string + publish: + description: 'Publish to JetBrains Marketplace' + required: false + type: boolean + default: true + skip_tests: + description: 'Skip integration tests' + required: false + type: boolean + default: false + +permissions: + contents: write + packages: write + id-token: write env: CX_BASE_URI: ${{ secrets.CX_BASE_URI }} @@ -43,12 +98,49 @@ env: CX_NOT_MATCH_TEST_BRANCH: ${{ secrets.CX_NOT_MATCH_TEST_BRANCH }} CX_NOT_MATCH_TEST_SCAN_ID: ${{ secrets.CX_NOT_MATCH_TEST_SCAN_ID }} - jobs: + resolve: + runs-on: ubuntu-latest + outputs: + releaseType: ${{ steps.vars.outputs.releaseType }} + ast_version: ${{ steps.vars.outputs.ast_version }} + devassist_version: ${{ steps.vars.outputs.devassist_version }} + gh_tag: ${{ steps.vars.outputs.gh_tag }} + steps: + - name: Resolve versions and tag + id: vars + run: | + TAG="${{ inputs.tag }}" + RELEASE_TYPE="${{ inputs.releaseType }}" + AST_VERSION="${{ inputs.ast_version }}" + DA_VERSION="${{ inputs.devassist_version }}" + CHANNEL="${{ inputs.rchannels }}" + + if [[ -z "${RELEASE_TYPE}" ]]; then + RELEASE_TYPE="both" + fi + + # Build GitHub release tag + if [[ -n "${CHANNEL}" ]]; then + GH_TAG="${TAG}-${CHANNEL}" + else + GH_TAG="${TAG}" + fi + + echo "releaseType=${RELEASE_TYPE}" >> "$GITHUB_OUTPUT" + echo "ast_version=${AST_VERSION}" >> "$GITHUB_OUTPUT" + echo "devassist_version=${DA_VERSION}" >> "$GITHUB_OUTPUT" + echo "gh_tag=${GH_TAG}" >> "$GITHUB_OUTPUT" + + echo "Release type: ${RELEASE_TYPE}" + echo "AST version: ${AST_VERSION}" + echo "DevAssist version: ${DA_VERSION}" + echo "GitHub tag: ${GH_TAG}" + verify: + needs: [resolve] runs-on: ubuntu-latest steps: - # Check out current repository - name: Checkout Code uses: actions/checkout@v4 - name: Free up disk space @@ -56,46 +148,42 @@ jobs: sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc sudo rm -rf /usr/local/lib/android - sudo docker system prune -af - # Setup Java 11 environment for the next steps + sudo docker system prune -af - name: Setup Java uses: actions/setup-java@v3.13.0 with: distribution: zulu java-version: 11 - # Run verifier - name: Run plugin verifier - run: ./gradlew runPluginVerifier + run: ./gradlew :plugin-checkmarx-ast:runPluginVerifier :plugin-checkmarx-devassist:runPluginVerifier env: - JAVA_TOOL_OPTIONS: > - -DpasswordSafe.enabled=false - # Upload verifier report + JAVA_TOOL_OPTIONS: > + -DpasswordSafe.enabled=false - name: Upload report uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4 if: always() with: name: verifier-report - path: build/reports/pluginVerifier + path: | + plugin-checkmarx-ast/build/reports/pluginVerifier + plugin-checkmarx-devassist/build/reports/pluginVerifier + testIntegration: - needs: [ verify ] + needs: [verify] + if: ${{ !inputs.skip_tests }} runs-on: ubuntu-latest steps: - # Check out current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java 11 environment for the next steps - name: Setup Java uses: actions/setup-java@v3.13.0 with: distribution: zulu java-version: 11 - # Perform clean before testing - name: Clean run: ./gradlew clean - # Run tests - name: Tests - run: ./gradlew test -i --tests com.checkmarx.intellij.integration.standard* - # Save report if tests fail + run: ./gradlew :plugin-checkmarx-ast:test -i --tests com.checkmarx.intellij.ast.test.integration.standard* - name: Save fails report if: ${{ failure() }} uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4 @@ -103,78 +191,167 @@ jobs: name: test-fails-report-integration path: | build/reports + deleteDevReleases: + needs: [resolve, verify, testIntegration] uses: Checkmarx/ast-jetbrains-plugin/.github/workflows/delete-dev-releases.yml@main with: tag: ${{ inputs.rchannels }} secrets: inherit - if: inputs.rchannels + if: ${{ always() && needs.verify.result == 'success' && (needs.testIntegration.result == 'success' || needs.testIntegration.result == 'skipped') && inputs.rchannels != '' && inputs.rchannels != null }} + release: + needs: [resolve, verify, testIntegration, deleteDevReleases] + if: ${{ always() && needs.resolve.result == 'success' && needs.verify.result == 'success' && (needs.testIntegration.result == 'success' || needs.testIntegration.result == 'skipped') && (needs.deleteDevReleases.result == 'success' || needs.deleteDevReleases.result == 'skipped') }} runs-on: ubuntu-latest outputs: TAG_NAME: ${{ steps.set_outputs.outputs.TAG_NAME }} CLI_VERSION: ${{ steps.set_outputs.outputs.CLI_VERSION }} steps: - # Check out current repository - name: Fetch Sources uses: actions/checkout@v4 - # Setup Java 11 environment for the next steps + with: + fetch-depth: 0 - name: Setup Java uses: actions/setup-java@v3.13.0 with: distribution: zulu java-version: 11 - # Set the tag in an env var - - name: Set env + + - name: Set versions run: | - echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV echo "JAVA_WRAPPER_VERSION=${{ inputs.javawrapperversion }}" >> $GITHUB_ENV - - name: Create Release Name + + # Always build BOTH plugins (both zips always present in release) + - name: Build plugin-checkmarx-ast + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "Creating release name" - if [ -z "${{ inputs.rchannels }}" ]; then - echo "GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV - else - echo "GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}-${{ inputs.rchannels }}" >> $GITHUB_ENV - fi - echo "Release name - ${{ env.GH_RELEASE_TAG_NAME }}" + RELEASE_VERSION="${{ needs.resolve.outputs.ast_version }}" \ + ./gradlew :plugin-checkmarx-ast:buildPlugin --info - # Build plugin - - name: Build + - name: Build plugin-checkmarx-devassist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew buildPlugin --info + run: | + RELEASE_VERSION="${{ needs.resolve.outputs.devassist_version }}" \ + ./gradlew :plugin-checkmarx-devassist:buildPlugin --info - name: Extract CLI version run: | chmod +x ./.github/scripts/extract_cli_version.sh ./.github/scripts/extract_cli_version.sh cx-linux - # Create the release or prerelease + - name: Generate Changelog + run: | + chmod +x ./.github/scripts/generateChangelog.sh + RELEASE_TYPE="${{ needs.resolve.outputs.releaseType }}" + AST_VER="${{ needs.resolve.outputs.ast_version }}" + DA_VER="${{ needs.resolve.outputs.devassist_version }}" + BODY_FILE="${RUNNER_TEMP}/release_body.md" + + # --- "Plugins in this release" header --- + { + echo "### Plugins in this release" + echo "" + if [[ "${RELEASE_TYPE}" == "checkmarx" || "${RELEASE_TYPE}" == "both" ]]; then + echo "- **Checkmarx (AST):** ${AST_VER} (NEW)" + else + echo "- **Checkmarx (AST):** ${AST_VER}" + fi + if [[ "${RELEASE_TYPE}" == "devAssist" || "${RELEASE_TYPE}" == "both" ]]; then + echo "- **Checkmarx Developer Assist:** ${DA_VER} (NEW)" + else + echo "- **Checkmarx Developer Assist:** ${DA_VER}" + fi + echo "" + } > "$BODY_FILE" + + # --- Per-plugin changelogs (only for plugins being released as NEW) --- + FIRST_SECTION=true + + if [[ "${RELEASE_TYPE}" == "checkmarx" || "${RELEASE_TYPE}" == "both" ]]; then + bash ./.github/scripts/generateChangelog.sh \ + --plugin checkmarx \ + --version "${AST_VER}" \ + --repo "${{ github.repository }}" \ + | sed -n '/RELEASE_BODY_START/,/RELEASE_BODY_END/{/RELEASE_BODY_START/d;/RELEASE_BODY_END/d;p}' \ + >> "$BODY_FILE" + FIRST_SECTION=false + fi + + if [[ "${RELEASE_TYPE}" == "devAssist" || "${RELEASE_TYPE}" == "both" ]]; then + if [[ "$FIRST_SECTION" == "false" ]]; then + echo "" >> "$BODY_FILE" + echo "---" >> "$BODY_FILE" + echo "" >> "$BODY_FILE" + fi + bash ./.github/scripts/generateChangelog.sh \ + --plugin devassist \ + --version "${DA_VER}" \ + --repo "${{ github.repository }}" \ + | sed -n '/RELEASE_BODY_START/,/RELEASE_BODY_END/{/RELEASE_BODY_START/d;/RELEASE_BODY_END/d;p}' \ + >> "$BODY_FILE" + fi + + echo "--- Release body ---" + cat "$BODY_FILE" + echo "--- End release body ---" + + echo "BODY_FILE=${BODY_FILE}" >> $GITHUB_ENV + + - name: Collect assets + run: | + mkdir -p release-assets + cp plugin-checkmarx-ast/build/distributions/*.zip release-assets/ + cp plugin-checkmarx-devassist/build/distributions/*.zip release-assets/ + + - name: Build release name + run: | + TAG="${{ needs.resolve.outputs.gh_tag }}" + if [[ -n "${{ inputs.rchannels }}" ]]; then + TIMESTAMP=$(date +%s) + echo "RELEASE_NAME=${TAG} (${TIMESTAMP})" >> "$GITHUB_ENV" + else + echo "RELEASE_NAME=${TAG}" >> "$GITHUB_ENV" + fi + - name: Create Release or Prerelease uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 #v1 with: - tag_name: ${{ env.GH_RELEASE_TAG_NAME }} - name: ${{ env.GH_RELEASE_TAG_NAME }} - files: build/distributions/* - generate_release_notes: true + tag_name: ${{ needs.resolve.outputs.gh_tag }} + name: ${{ env.RELEASE_NAME }} + files: release-assets/* prerelease: ${{ inputs.rchannels != '' && inputs.rchannels != null }} + body_path: ${{ env.BODY_FILE }} - name: Echo CLI version and tag name to outputs id: set_outputs run: | - echo "::set-output name=TAG_NAME::${{ env.GH_RELEASE_TAG_NAME }}" - echo "::set-output name=CLI_VERSION::${{ env.CLI_VERSION }}" + echo "TAG_NAME=${{ needs.resolve.outputs.gh_tag }}" >> "$GITHUB_OUTPUT" + echo "CLI_VERSION=${{ env.CLI_VERSION }}" >> "$GITHUB_OUTPUT" - # Publish the plugin in marketplace + # Publish only the plugin(s) selected by releaseType - name: Publish Plugin + if: ${{ inputs.publish != false }} env: PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} run: | - if [ -z "${{ inputs.rchannels }}" ]; then - ./gradlew publishPlugin - else - ./gradlew publishPlugin -Prchannels=${{ inputs.rchannels }} + CHANNEL_ARG="" + if [[ -n "${{ inputs.rchannels }}" ]]; then + CHANNEL_ARG="-Prchannels=${{ inputs.rchannels }}" + fi + + RELEASE_TYPE="${{ needs.resolve.outputs.releaseType }}" + if [[ "${RELEASE_TYPE}" == "both" || "${RELEASE_TYPE}" == "checkmarx" ]]; then + echo "Publishing plugin-checkmarx-ast..." + RELEASE_VERSION="${{ needs.resolve.outputs.ast_version }}" \ + ./gradlew :plugin-checkmarx-ast:publishPlugin ${CHANNEL_ARG} + fi + if [[ "${RELEASE_TYPE}" == "both" || "${RELEASE_TYPE}" == "devAssist" ]]; then + echo "Publishing plugin-checkmarx-devassist..." + RELEASE_VERSION="${{ needs.resolve.outputs.devassist_version }}" \ + ./gradlew :plugin-checkmarx-devassist:publishPlugin ${CHANNEL_ARG} fi notify: @@ -182,7 +359,10 @@ jobs: needs: release uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main with: - product_name: JetBrains Plugin + product_name: >- + ${{ inputs.releaseType == 'checkmarx' && 'JetBrains Plugin - Checkmarx (AST)' || + inputs.releaseType == 'devAssist' && 'JetBrains Plugin - DevAssist' || + 'JetBrains Plugin - Checkmarx (AST) & DevAssist' }} release_version: ${{ needs.release.outputs.TAG_NAME }} cli_release_version: ${{ needs.release.outputs.CLI_VERSION }} release_author: "Sypher Team" diff --git a/build.gradle b/build.gradle index 0f4cb9d6..ee37f436 100644 --- a/build.gradle +++ b/build.gradle @@ -79,4 +79,8 @@ intellij { runPluginVerifier { ideVersions = verifierIdeVersions.split(',').toList() +} + +[verifyPlugin, runPluginVerifier, buildSearchableOptions, patchPluginXml].each { + tasks.named(it.name) { enabled = false } } \ No newline at end of file diff --git a/common-lib/build.gradle b/common-lib/build.gradle index bd343e13..cdb9de9b 100644 --- a/common-lib/build.gradle +++ b/common-lib/build.gradle @@ -18,4 +18,8 @@ tasks.withType(JavaCompile).configureEach { test { useJUnitPlatform() +} + +[buildSearchableOptions, patchPluginXml, verifyPlugin, runPluginVerifier, listProductsReleases, prepareSandbox, buildPlugin, jarSearchableOptions].each { + tasks.named(it.name) { enabled = false } } \ No newline at end of file diff --git a/devassist-lib/build.gradle b/devassist-lib/build.gradle index 14b6c409..8d678691 100644 --- a/devassist-lib/build.gradle +++ b/devassist-lib/build.gradle @@ -41,4 +41,8 @@ jacocoTestReport { csv.required = true html.required = true } +} + +[buildSearchableOptions, patchPluginXml, verifyPlugin, runPluginVerifier, listProductsReleases, prepareSandbox, buildPlugin, jarSearchableOptions].each { + tasks.named(it.name) { enabled = false } } \ No newline at end of file diff --git a/plugin-checkmarx-devassist/build.gradle b/plugin-checkmarx-devassist/build.gradle index c39e3ccc..ca49b083 100644 --- a/plugin-checkmarx-devassist/build.gradle +++ b/plugin-checkmarx-devassist/build.gradle @@ -22,9 +22,15 @@ patchPluginXml { sinceBuild = "${sinceBuildVersion}" } +runPluginVerifier { + ideVersions = verifierIdeVersions.split(',').toList() +} + publishPlugin { token.set System.getenv("PUBLISH_TOKEN") - channels = ['stable'] + if (project.hasProperty("rchannels")) { + channels = [rchannels.toString()] + } } test {