diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index 1190619..da9cdd6 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -1,9 +1,12 @@ name: Build PyCharm Plugin on: - release: - types: [created, published] workflow_dispatch: + inputs: + version: + description: 'Version tag (e.g., 0.2.1)' + required: true + type: string jobs: build: @@ -48,23 +51,20 @@ jobs: fi working-directory: ide-plugins + - name: Set version environment variable + run: echo "PLUGIN_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + - name: Build plugin env: GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g" - run: ./gradlew buildPlugin --no-daemon --stacktrace - working-directory: ide-plugins - - - name: Get plugin version - id: plugin_version - run: | - VERSION=$(grep "^version" build.gradle.kts | cut -d'"' -f2) - echo "version=$VERSION" >> $GITHUB_OUTPUT + PLUGIN_VERSION: ${{ github.event.inputs.version }} + run: ./gradlew buildPlugin -Pversion=${{ github.event.inputs.version }} --no-daemon --stacktrace working-directory: ide-plugins - name: Upload plugin artifact uses: actions/upload-artifact@v4 with: - name: picocode-plugin-${{ steps.plugin_version.outputs.version }} + name: intellij-plugin-${{ github.event.inputs.version }} path: ide-plugins/build/distributions/*.zip - name: Upload to Release diff --git a/ide-plugins/README.md b/ide-plugins/README.md index 31b0cdc..c327569 100644 --- a/ide-plugins/README.md +++ b/ide-plugins/README.md @@ -14,11 +14,15 @@ PyCharm/IntelliJ IDEA plugin for PicoCode RAG Assistant with per-project persist ## Building the Plugin ```bash -cd plugin +cd ide-plugins +# Build with default version (0.2.0) ./gradlew buildPlugin + +# Or build with a specific version +./gradlew buildPlugin -Pversion=0.2.1 ``` -The plugin ZIP will be in `build/distributions/`. +The plugin ZIP will be in `build/distributions/` with the name `intellij-plugin-{version}.zip`. ## Installation @@ -72,8 +76,8 @@ Hover over the status to see detailed information including file and embedding c To modify the plugin: -1. Open `plugin/` in IntelliJ IDEA +1. Open `ide-plugins/` in IntelliJ IDEA 2. Make changes to Kotlin files 3. Run `./gradlew runIde` to test in a sandbox IDE -4. Build with `./gradlew buildPlugin` +4. Build with `./gradlew buildPlugin` (optionally with `-Pversion=x.y.z`) diff --git a/ide-plugins/build.gradle.kts b/ide-plugins/build.gradle.kts index 83cd7be..ae433f8 100644 --- a/ide-plugins/build.gradle.kts +++ b/ide-plugins/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "com.picocode" -version = "0.2.0" +version = project.findProperty("version") as String? ?: "0.2.0" repositories { mavenCentral() @@ -35,4 +35,12 @@ tasks { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) } } + + buildPlugin { + archiveBaseName.set("intellij-plugin") + } + + patchPluginXml { + version.set(project.version.toString()) + } } diff --git a/ide-plugins/src/main/resources/META-INF/plugin.xml b/ide-plugins/src/main/resources/META-INF/plugin.xml index 2689f60..37b035b 100644 --- a/ide-plugins/src/main/resources/META-INF/plugin.xml +++ b/ide-plugins/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,6 @@ com.picocode.rag-assistant PicoCode RAG Assistant - 0.2.0 PicoCode