Skip to content

Commit 269f85d

Browse files
CopilotMte90
andauthored
Make plugin build manual-only with dynamic versioning (#23)
Co-authored-by: Mte90 <403283+Mte90@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent dce2446 commit 269f85d

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

.github/workflows/build-plugin.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Build PyCharm Plugin
22

33
on:
4-
release:
5-
types: [created, published]
64
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version tag (e.g., 0.2.1)'
8+
required: true
9+
type: string
710

811
jobs:
912
build:
@@ -48,23 +51,20 @@ jobs:
4851
fi
4952
working-directory: ide-plugins
5053

54+
- name: Set version environment variable
55+
run: echo "PLUGIN_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
56+
5157
- name: Build plugin
5258
env:
5359
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx3g"
54-
run: ./gradlew buildPlugin --no-daemon --stacktrace
55-
working-directory: ide-plugins
56-
57-
- name: Get plugin version
58-
id: plugin_version
59-
run: |
60-
VERSION=$(grep "^version" build.gradle.kts | cut -d'"' -f2)
61-
echo "version=$VERSION" >> $GITHUB_OUTPUT
60+
PLUGIN_VERSION: ${{ github.event.inputs.version }}
61+
run: ./gradlew buildPlugin -Pversion=${{ github.event.inputs.version }} --no-daemon --stacktrace
6262
working-directory: ide-plugins
6363

6464
- name: Upload plugin artifact
6565
uses: actions/upload-artifact@v4
6666
with:
67-
name: picocode-plugin-${{ steps.plugin_version.outputs.version }}
67+
name: intellij-plugin-${{ github.event.inputs.version }}
6868
path: ide-plugins/build/distributions/*.zip
6969

7070
- name: Upload to Release

ide-plugins/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ PyCharm/IntelliJ IDEA plugin for PicoCode RAG Assistant with per-project persist
1414
## Building the Plugin
1515

1616
```bash
17-
cd plugin
17+
cd ide-plugins
18+
# Build with default version (0.2.0)
1819
./gradlew buildPlugin
20+
21+
# Or build with a specific version
22+
./gradlew buildPlugin -Pversion=0.2.1
1923
```
2024

21-
The plugin ZIP will be in `build/distributions/`.
25+
The plugin ZIP will be in `build/distributions/` with the name `intellij-plugin-{version}.zip`.
2226

2327
## Installation
2428

@@ -72,8 +76,8 @@ Hover over the status to see detailed information including file and embedding c
7276

7377
To modify the plugin:
7478

75-
1. Open `plugin/` in IntelliJ IDEA
79+
1. Open `ide-plugins/` in IntelliJ IDEA
7680
2. Make changes to Kotlin files
7781
3. Run `./gradlew runIde` to test in a sandbox IDE
78-
4. Build with `./gradlew buildPlugin`
82+
4. Build with `./gradlew buildPlugin` (optionally with `-Pversion=x.y.z`)
7983

ide-plugins/build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "com.picocode"
8-
version = "0.2.0"
8+
version = project.findProperty("version") as String? ?: "0.2.0"
99

1010
repositories {
1111
mavenCentral()
@@ -35,4 +35,12 @@ tasks {
3535
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
3636
}
3737
}
38+
39+
buildPlugin {
40+
archiveBaseName.set("intellij-plugin")
41+
}
42+
43+
patchPluginXml {
44+
version.set(project.version.toString())
45+
}
3846
}

ide-plugins/src/main/resources/META-INF/plugin.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<idea-plugin>
22
<id>com.picocode.rag-assistant</id>
33
<name>PicoCode RAG Assistant</name>
4-
<version>0.2.0</version>
54
<vendor>PicoCode</vendor>
65

76
<description><![CDATA[

0 commit comments

Comments
 (0)