Skip to content

Commit b94faa0

Browse files
committed
feat(jetbrains): add JetBrains Marketplace publishing support
- Add Gradle wrapper (gradlew, gradlew.bat, gradle-wrapper.jar) - Add JetBrains publishing job to GitHub Actions workflow - Create comprehensive publishing guide (docs/JETBRAINS_PUBLISH.md) - Add .gitignore for JetBrains plugin build artifacts Publishing will be automated on next tag (v2.10.0+) when JETBRAINS_PUBLISH_TOKEN secret is configured
1 parent 7008a9b commit b94faa0

7 files changed

Lines changed: 798 additions & 2 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,55 @@ jobs:
165165
env:
166166
OVSX_PAT: ${{ secrets.OVSX_PAT }}
167167

168-
# ── 6. Create GitHub Release (after all publishes succeed) ────────────────
168+
# ── 6. Publish JetBrains Plugin ───────────────────────────────────────────
169+
publish-jetbrains:
170+
name: Publish → JetBrains Marketplace
171+
needs: test
172+
runs-on: ubuntu-latest
173+
steps:
174+
- uses: actions/checkout@v4
175+
176+
- uses: actions/setup-java@v4
177+
with:
178+
java-version: '17'
179+
distribution: 'temurin'
180+
181+
- name: Setup Gradle
182+
uses: gradle/gradle-build-action@v3
183+
184+
- name: Verify plugin version matches tag
185+
run: |
186+
TAG_VERSION="${GITHUB_REF_NAME#v}"
187+
PLUGIN_VERSION=$(grep '^version = ' jetbrains-plugin/build.gradle.kts | sed 's/version = "\(.*\)"/\1/')
188+
if [ "$PLUGIN_VERSION" != "$TAG_VERSION" ]; then
189+
echo "ERROR: plugin version ($PLUGIN_VERSION) does not match tag ($TAG_VERSION)"
190+
exit 1
191+
fi
192+
echo "✓ plugin version check passed: $PLUGIN_VERSION"
193+
194+
- name: Build and verify plugin
195+
working-directory: jetbrains-plugin
196+
run: |
197+
./gradlew buildPlugin verifyPlugin
198+
echo "✓ Plugin built and verified successfully"
199+
200+
- name: Publish plugin to JetBrains Marketplace
201+
working-directory: jetbrains-plugin
202+
run: |
203+
./gradlew publishPlugin 2>&1 | tee /tmp/jetbrains-out.txt
204+
EXIT=${PIPESTATUS[0]}
205+
if [ $EXIT -ne 0 ] && grep -q "already exists" /tmp/jetbrains-out.txt; then
206+
echo "✓ Version already on JetBrains Marketplace — skipping (not an error)"
207+
exit 0
208+
fi
209+
exit $EXIT
210+
env:
211+
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }}
212+
213+
# ── 7. Create GitHub Release (after all publishes succeed) ────────────────
169214
release:
170215
name: Create GitHub Release
171-
needs: [publish-npm, publish-github, publish-vscode, publish-openvsx]
216+
needs: [publish-npm, publish-github, publish-vscode, publish-openvsx, publish-jetbrains]
172217
runs-on: ubuntu-latest
173218
steps:
174219
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)