Skip to content

Commit 18b57dd

Browse files
authored
feat: jetbrains extension, syntax highlighting and release automation only (#1983)
Implement jetbrains extension and set up jetbrains release automation. The only thing implemented in the jetbrains extension right now is syntax highlighting. We still need to: - fix icons - add the webview (via JCEF) - add codelenses (not sure what the Jetbrains equivalent is) - wire up the LSP (via lsp4ij from redhat) - set up LSP downloading (and platform-specific logic) - LSP packaging and release process there But this lets us start iterating on it asap in prod.
1 parent f4c8cf3 commit 18b57dd

66 files changed

Lines changed: 3762 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2+
# - Validate Gradle Wrapper.
3+
# - Run 'test' and 'verifyPlugin' tasks.
4+
# - Run Qodana inspections.
5+
# - Run the 'buildPlugin' task and prepare artifact for further tests.
6+
# - Run the 'runPluginVerifier' task.
7+
# - Create a draft release.
8+
#
9+
# The workflow is triggered on push and pull_request events.
10+
#
11+
# GitHub Actions reference: https://help.github.com/en/actions
12+
13+
name: BAML Release - Build JetBrains
14+
on:
15+
workflow_call: {}
16+
push:
17+
branches:
18+
- sam/jetbrains
19+
20+
permissions:
21+
contents: read
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-build-jetbrains
25+
cancel-in-progress: true
26+
27+
defaults:
28+
run:
29+
working-directory: ./jetbrains
30+
31+
jobs:
32+
# Prepare environment and build the plugin
33+
build:
34+
name: Build
35+
runs-on: ubuntu-latest
36+
outputs:
37+
version: ${{ steps.properties.outputs.version }}
38+
changelog: ${{ steps.properties.outputs.changelog }}
39+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
40+
steps:
41+
42+
- uses: actions/checkout@v4
43+
44+
- uses: actions/setup-java@v4
45+
with:
46+
distribution: temurin
47+
java-version: 23
48+
49+
- uses: gradle/actions/setup-gradle@v4
50+
51+
# Set environment variables
52+
- name: Export Properties
53+
id: properties
54+
shell: bash
55+
run: |
56+
PROPERTIES="$(./gradlew properties --console=plain -q)"
57+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
58+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
59+
60+
echo "version=$VERSION" >> $GITHUB_OUTPUT
61+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
62+
63+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
64+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
65+
echo "EOF" >> $GITHUB_OUTPUT
66+
67+
# Build plugin
68+
- name: Build plugin
69+
run: ./gradlew buildPlugin
70+
71+
- name: Upload artifact
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: baml-jetbrains-zip
75+
path: ./jetbrains/build/distributions/*
76+
77+
# # Run tests and upload a code coverage report
78+
# test:
79+
# name: Test
80+
# needs: [ build ]
81+
# runs-on: ubuntu-latest
82+
# steps:
83+
84+
# # Check out the current repository
85+
# - name: Fetch Sources
86+
# uses: actions/checkout@v4
87+
88+
# # Set up Java environment for the next steps
89+
# - name: Setup Java
90+
# uses: actions/setup-java@v4
91+
# with:
92+
# distribution: zulu
93+
# java-version: 21
94+
95+
# # Setup Gradle
96+
# - name: Setup Gradle
97+
# uses: gradle/actions/setup-gradle@v4
98+
99+
# # Run tests
100+
# - name: Run Tests
101+
# run: ./gradlew check
102+
103+
# # Collect Tests Result of failed tests
104+
# - name: Collect Tests Result
105+
# if: ${{ failure() }}
106+
# uses: actions/upload-artifact@v4
107+
# with:
108+
# name: tests-result
109+
# path: ./build/reports/tests
110+
111+
# # Upload the Kover report to CodeCov
112+
# - name: Upload Code Coverage Report
113+
# uses: codecov/codecov-action@v5
114+
# with:
115+
# files: ./build/reports/kover/report.xml
116+
117+
# # Run Qodana inspections and provide report
118+
# inspectCode:
119+
# name: Inspect code
120+
# needs: [ build ]
121+
# runs-on: ubuntu-latest
122+
# permissions:
123+
# contents: write
124+
# checks: write
125+
# pull-requests: write
126+
# steps:
127+
# # Check out the current repository
128+
# - uses: actions/checkout@v4
129+
# with:
130+
# ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
131+
# fetch-depth: 0 # a full history is required for pull request analysis
132+
133+
# # Set up Java environment for the next steps
134+
# - uses: actions/setup-java@v4
135+
# with:
136+
# distribution: temurin
137+
# java-version: 23
138+
139+
# # Run Qodana inspections
140+
# - name: Qodana - Code Inspection
141+
# uses: JetBrains/qodana-action@v2025.1
142+
# with:
143+
# cache-default-branch-only: true
144+
145+
# # Run plugin structure verification along with IntelliJ Plugin Verifier
146+
# verify:
147+
# name: Verify plugin
148+
# needs: [ build ]
149+
# runs-on: ubuntu-latest
150+
# steps:
151+
# - uses: actions/checkout@v4
152+
153+
# # Set up Java environment for the next steps
154+
# - name: Setup Java
155+
# uses: actions/setup-java@v4
156+
# with:
157+
# distribution: temurin
158+
# java-version: 23
159+
160+
# # Setup Gradle
161+
# - name: Setup Gradle
162+
# uses: gradle/actions/setup-gradle@v4
163+
164+
# # Cache Plugin Verifier IDEs
165+
# - name: Setup Plugin Verifier IDEs Cache
166+
# uses: actions/cache@v4
167+
# with:
168+
# path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
169+
# key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
170+
171+
# # Run Verify Plugin task and IntelliJ Plugin Verifier tool
172+
# - name: Run Plugin Verification tasks
173+
# run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
174+
175+
# # Collect Plugin Verifier Result
176+
# - name: Collect Plugin Verifier Result
177+
# if: ${{ always() }}
178+
# uses: actions/upload-artifact@v4
179+
# with:
180+
# name: pluginVerifier-result
181+
# path: ./build/reports/pluginVerifier

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
version: ${{ needs.determine-version.outputs.version_string }}
8787
# Pass the boolean output directly
8888
is_release_build: ${{ needs.determine-version.outputs.is_release_tag == 'true' }}
89+
90+
build-jetbrains-release:
91+
uses: ./.github/workflows/build-jetbrains-release.reusable.yaml
8992

9093
# Kick off integration tests when we build everything.
9194
# This does not yet succeed/pass consistently, or even run everything, but it's a good start.
@@ -103,6 +106,7 @@ jobs:
103106
- build-typescript-release
104107
- build-cli
105108
- build-vscode-reusable # Depends on the job calling the reusable workflow
109+
- build-jetbrains-release
106110
steps:
107111
- run: echo "::do-nothing::" >/dev/null
108112

@@ -288,6 +292,40 @@ jobs:
288292
env:
289293
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
290294

295+
publish-to-jetbrains-marketplace:
296+
environment: release
297+
needs: [determine-version, all-builds] # Also need determine-version for the condition
298+
runs-on: ubuntu-latest
299+
defaults:
300+
run:
301+
working-directory: ./jetbrains
302+
steps:
303+
# We need checkout, java, and gradle because there's no CLI for publishing
304+
# to JetBrains Marketplace, just a gradle task in the project.
305+
- uses: actions/checkout@v4
306+
- uses: actions/setup-java@v4
307+
with:
308+
distribution: temurin
309+
java-version: 23
310+
- uses: gradle/actions/setup-gradle@v4
311+
312+
- name: Download extension zips
313+
uses: actions/download-artifact@v4
314+
with:
315+
pattern: baml-jetbrains-zip-*
316+
path: ./jetbrains/build/distributions/
317+
merge-multiple: true
318+
319+
- name: List downloaded extension zips
320+
run: ls -al ./jetbrains/build/distributions/
321+
322+
- name: Publish to JetBrains Marketplace
323+
working-directory: ./jetbrains
324+
run: ./gradlew publishPlugin
325+
env:
326+
INTELLIJ_PLATFORM_PUBLISH_TOKEN: ${{ secrets.SAM_INTELLIJ_PLATFORM_PUBLISH_TOKEN }}
327+
328+
291329
publish-to-github:
292330
environment: release
293331
permissions:
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
labels: ["bug"]
4+
body:
5+
6+
- type: textarea
7+
id: issue
8+
attributes:
9+
label: What happened?
10+
description: A clear and concise description of what the bug is.
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: logs
16+
attributes:
17+
label: Relevant log output or stack trace
18+
description: |
19+
Please copy and paste any relevant log output.
20+
Add the full stack trace if available.
21+
If possible, run the failing task with `--stacktrace` flag.
22+
23+
*This will be automatically formatted into code, so there is no need for backticks.*
24+
render: shell
25+
26+
- type: textarea
27+
id: steps
28+
attributes:
29+
label: Steps to reproduce
30+
description: Steps to reproduce the behavior – provide your build configuration.
31+
validations:
32+
required: true
33+
34+
- type: input
35+
id: version
36+
attributes:
37+
label: Gradle IntelliJ Plugin version
38+
placeholder: 1.16.0
39+
validations:
40+
required: true
41+
42+
- type: input
43+
id: gradle
44+
attributes:
45+
label: Gradle version
46+
placeholder: 8.2.1
47+
validations:
48+
required: true
49+
50+
- type: dropdown
51+
id: os
52+
attributes:
53+
label: Operating System
54+
options:
55+
- macOS
56+
- Linux
57+
- Windows
58+
59+
- type: input
60+
id: url
61+
attributes:
62+
label: Link to build, i.e. failing GitHub Action job
63+
placeholder: https://github.com/username/project/actions/runs/1234567890
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Documentation
4+
url: https://github.com/JetBrains/intellij-platform-plugin-template
5+
about: Check the README file in the first place.
6+
- name: Getting Help
7+
url: https://plugins.jetbrains.com/docs/intellij/getting-help.html
8+
about: Check if you search for a help in plugin development.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
labels: ["enhancement"]
4+
body:
5+
6+
- type: textarea
7+
id: cause
8+
attributes:
9+
label: Describe the need of your request
10+
description: A clear and concise description of what the need or problem is.
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: solution
16+
attributes:
17+
label: Proposed solution
18+
description: A clear and concise description of what you want to happen.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: alternatives
24+
attributes:
25+
label: Alternatives you've considered
26+
description: What did you try so far to accomplish the goal?
27+
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional context
32+
description: Add any other context or screenshots about the feature request here.

jetbrains/.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dependabot configuration:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Maintain dependencies for Gradle dependencies
7+
- package-ecosystem: "gradle"
8+
directory: "/"
9+
target-branch: "next"
10+
schedule:
11+
interval: "daily"
12+
# Maintain dependencies for GitHub Actions
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
target-branch: "next"
16+
schedule:
17+
interval: "daily"
64.2 KB
Loading
98.3 KB
Loading

0 commit comments

Comments
 (0)