Skip to content

Commit 6cd6486

Browse files
committed
chore: integrate intellij plugin in package workflow
1 parent f6b07fd commit 6cd6486

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

.github/workflows/build-test-package-publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,30 @@ jobs:
149149
cache: "npm"
150150
cache-dependency-path: package-lock.json
151151

152+
# Validate wrapper
153+
- name: Gradle Wrapper Validation
154+
uses: gradle/actions/wrapper-validation@v4
155+
156+
# Set up Java environment for the next steps
157+
- name: Setup Java
158+
uses: actions/setup-java@v4
159+
with:
160+
distribution: zulu
161+
java-version: 21
162+
163+
# Setup Gradle
164+
- name: Setup Gradle
165+
uses: gradle/actions/setup-gradle@v4
166+
with:
167+
gradle-home-cache-cleanup: true
168+
169+
# Set environment variables
170+
- name: Export Properties
171+
id: properties
172+
shell: bash
173+
run: |
174+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
175+
152176
- name: install node modules
153177
run: npm install --also=dev
154178

@@ -160,6 +184,9 @@ jobs:
160184
if: ${{ startsWith( github.ref, 'refs/tags/v') }}
161185
run: hatch run build:update-doc-links
162186

187+
- name: Update Changelog
188+
run: hatch run build:git-cliff -o CHANGELOG.md
189+
163190
- name: package
164191
run: hatch run build:package
165192

@@ -181,6 +208,23 @@ jobs:
181208
name: wheel-package
182209
path: dist/*.whl
183210

211+
- name: Prepare IntelliJ Plugin Artifact
212+
id: artifact
213+
shell: bash
214+
run: |
215+
cd ${{ github.workspace }}/intellij-client/build/distributions
216+
FILENAME=`ls *.zip`
217+
unzip "$FILENAME" -d content
218+
219+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
220+
221+
# Store already-built plugin as an artifact for downloading
222+
- name: Upload IntelliJ plugin
223+
uses: actions/upload-artifact@v4
224+
with:
225+
name: ${{ steps.artifact.outputs.filename }}
226+
path: ./intellij-client/build/distributions/content/*/*
227+
184228
publish:
185229
runs-on: ubuntu-latest
186230
needs: package

cliff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body = """
2121
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
2222
{% endif %}\
2323
{% else %}\
24-
## [unreleased]
24+
## [Unreleased]
2525
{% endif %}\
2626
{% for group, commits in commits | group_by(attribute="group") %}
2727
### {{ group | upper_first }}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ exclude = [
251251
"^playground/",
252252
"^scripts/",
253253
"^bundled/libs/",
254+
"^intellij-client/",
254255
]
255256
mypy_path = [
256257
"typings",

scripts/package.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def main() -> None:
5858
check=False,
5959
).check_returncode()
6060

61+
shutil.rmtree("./intellij-client/build", ignore_errors=True)
62+
run("gradlew buildPlugin --console=plain", shell=True, check=False, cwd="intellij-client").check_returncode()
63+
6164

6265
if __name__ == "__main__":
6366
main()

scripts/update_git_versions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ def main() -> None:
7373
rf"\g<1>{version or ''}\g<3>",
7474
)
7575

76+
for f in [Path("intellij-client/gradle.properties")]:
77+
replace_in_file(
78+
f,
79+
re.compile(r"""(^pluginVersion\s*=\s*)([0-9]+\S*)""", re.MULTILINE),
80+
rf"\g<1>{version or ''}",
81+
)
82+
7683

7784
if __name__ == "__main__":
7885
main()

0 commit comments

Comments
 (0)