From 18c6b8f43c0c4095edd0bbe31a6e80e6317b3962 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 26 Mar 2026 13:58:19 +0400 Subject: [PATCH 1/3] CI: run tests and verification before building artifacts Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c33abffa1..03e96b57c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -43,6 +43,12 @@ jobs: BASE_VERSION=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2) echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV + - name: Run tests + run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} + + - name: Verify plugin + run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} + - name: Build plugin run: ./gradlew buildPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} @@ -53,12 +59,6 @@ jobs: path: intellij-plugin/build/distributions retention-days: 3 - - name: Run tests - run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} - - - name: Verify plugin - run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} - - name: Publish plugin to Marketplace (dev channel) if: github.ref == 'refs/heads/main' && github.event_name == 'push' run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} From d5096e90e97c9ea4d926ae16d5752b6db15005fc Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 26 Mar 2026 14:08:23 +0400 Subject: [PATCH 2/3] CI: split into separate CI and Publish workflows - ci.yaml: tests + verification on PRs and push to main - publish.yaml: build + publish on push to main and GitHub release Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yaml | 48 ++++++++++++++++++++++++++++++++++ .github/workflows/publish.yaml | 15 +++-------- 2 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..737b8f8b7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + +concurrency: + group: ci-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + check: + name: Check the plugin for ${{ matrix.environmentName }} + runs-on: arc-runners-large + timeout-minutes: 60 + strategy: + matrix: + environmentName: + - 252 + - 253 + - 261 + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup Corretto JDK + uses: actions/setup-java@v4 + with: + java-version-file: '.java-version' + distribution: 'corretto' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Resolve plugin version + run: | + BASE_VERSION=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2) + echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV + + - name: Run tests + run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} + + - name: Verify plugin + run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 03e96b57c..a2fb3a548 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,19 +1,18 @@ -name: Plugin deployment +name: Publish on: push: branches: [ main ] - pull_request: release: types: [ published ] concurrency: - group: publish-plugin-${{ github.ref_name }} + group: publish-${{ github.ref_name }} cancel-in-progress: true jobs: - deploy: - name: Deploy the plugin for ${{ matrix.environmentName }} + publish: + name: Publish the plugin for ${{ matrix.environmentName }} runs-on: arc-runners-large timeout-minutes: 60 strategy: @@ -43,12 +42,6 @@ jobs: BASE_VERSION=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2) echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV - - name: Run tests - run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} - - - name: Verify plugin - run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} - - name: Build plugin run: ./gradlew buildPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} From 9e4beabcf3ec9a0628864eecf3b58353f44af388 Mon Sep 17 00:00:00 2001 From: meanmail Date: Thu, 26 Mar 2026 14:10:23 +0400 Subject: [PATCH 3/3] CI: make Publish workflow depend on successful CI Use workflow_run trigger so publishing only runs after CI passes. Release events still trigger directly (CI doesn't run on releases). Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index a2fb3a548..16a51488a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,9 @@ name: Publish on: - push: + workflow_run: + workflows: [ CI ] + types: [ completed ] branches: [ main ] release: types: [ published ] @@ -15,6 +17,9 @@ jobs: name: Publish the plugin for ${{ matrix.environmentName }} runs-on: arc-runners-large timeout-minutes: 60 + if: > + (github.event_name == 'release') || + (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') strategy: matrix: environmentName: @@ -53,7 +58,7 @@ jobs: retention-days: 3 - name: Publish plugin to Marketplace (dev channel) - if: github.ref == 'refs/heads/main' && github.event_name == 'push' + if: github.event_name == 'workflow_run' run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }} env: JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}