Skip to content
This repository was archived by the owner on May 30, 2026. It is now read-only.

Bump release version to 8.0.4 #6

Bump release version to 8.0.4

Bump release version to 8.0.4 #6

name: Refact JetBrains Plugin Release
on:
workflow_dispatch:
inputs:
stable_release:
description: "Publish stable release version"
default: false
type: boolean
push:
tags:
- "release/v*"
concurrency:
group: plugin-intellij-release-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
engine:
uses: ./.github/workflows/agent_engine_build.yml
gui:
uses: ./.github/workflows/agent_gui_build.yml
release:
name: release
needs: [engine, gui]
runs-on: ubuntu-latest
outputs:
version: ${{ steps.setupvars.outputs.plugin_version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Set release channel and check tag version
shell: bash
id: setupvars
working-directory: plugins/intellij
run: |
if [[ "${{ github.event_name }}" == "push" || "${{ inputs.stable_release }}" == "true" ]]; then
echo "PUBLISH_CHANNEL=default" >> "$GITHUB_ENV"
echo "PUBLISH_EAP=0" >> "$GITHUB_ENV"
else
echo "PUBLISH_CHANNEL=eap" >> "$GITHUB_ENV"
echo "PUBLISH_EAP=1" >> "$GITHUB_ENV"
fi
PLUGIN_VERSION="$(./gradlew properties -q | awk '/^version:/ {print $2}')"
if [[ "${{ github.ref }}" == refs/tags/release/v* ]]; then
TAG_VERSION="${GITHUB_REF_NAME#release/v}"
if [[ "$TAG_VERSION" != "$PLUGIN_VERSION" ]]; then
echo "release tag version $TAG_VERSION does not match JetBrains plugin version $PLUGIN_VERSION"
exit 1
fi
fi
echo "plugin_version=${PLUGIN_VERSION}" >> "$GITHUB_OUTPUT"
- name: Download GUI package
uses: actions/download-artifact@v4
with:
pattern: lts-refact-chat-js-*.tgz
path: plugins/intellij/chat_package
merge-multiple: true
- name: Prepare GUI package
shell: bash
working-directory: plugins/intellij
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec tar -xzf {} -C ./chat_package_fixed/ \;
rm -rf ./src/main/resources/webview/dist
mv ./chat_package_fixed/package/dist ./src/main/resources/webview/dist
rm -rf ./chat_package ./chat_package_fixed
- name: Download engine artifacts
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: plugins/intellij/src/main/resources/bin
- name: Make engine artifacts executable
shell: bash
working-directory: plugins/intellij
run: chmod +x ./src/main/resources/bin/dist-*/refact-lsp || true
- name: Export properties
id: properties
shell: bash
working-directory: plugins/intellij
run: |
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
./gradlew properties --console=plain -q
./gradlew printProductsReleases
- name: Run tests
working-directory: plugins/intellij
run: ./gradlew check
- name: Collect test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: intellij-tests-result
path: plugins/intellij/build/reports/tests
- name: Setup Plugin Verifier IDEs cache
uses: actions/cache@v4
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('plugins/intellij/build/listProductsReleases.txt') }}
- name: Run plugin verification tasks
working-directory: plugins/intellij
run: |
for attempt in 1 2; do
if ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}; then
exit 0
fi
if [[ "$attempt" == "2" ]]; then
exit 1
fi
echo "Plugin verifier failed, retrying once after cleaning verifier reports"
rm -rf build/reports/pluginVerifier
sleep 10
done
- name: Collect plugin verifier result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: intellij-pluginVerifier-result
path: plugins/intellij/build/reports/pluginVerifier
- name: Prepare plugin artifact
id: artifact
shell: bash
working-directory: plugins/intellij
run: |
cd build/distributions
FILENAME=$(ls *.zip)
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload JetBrains plugin artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: plugins/intellij/build/distributions/content/*/*
- name: Publish JetBrains plugin
working-directory: plugins/intellij
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
PUBLISH_CHANNEL: ${{ env.PUBLISH_CHANNEL }}
PUBLISH_EAP: ${{ env.PUBLISH_EAP }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: |
set +e
./gradlew publishPlugin 2>&1 | tee publishPlugin.log
status=${PIPESTATUS[0]}
set -e
if [[ "$status" -eq 0 ]]; then
exit 0
fi
if grep -q "plugin already contains version" publishPlugin.log; then
echo "JetBrains Marketplace already contains version ${{ steps.setupvars.outputs.plugin_version }}; treating publish as successful for an idempotent release rerun."
exit 0
fi
exit "$status"
- name: Upload JetBrains plugin to release
if: startsWith(github.ref, 'refs/tags/release/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: plugins/intellij/build/distributions/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true