Skip to content

Commit

Permalink
chore: integrate intellij plugin in package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
d-biehl committed Dec 29, 2024
1 parent f6b07fd commit 6cd6486
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/build-test-package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ jobs:
cache: "npm"
cache-dependency-path: package-lock.json

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
- name: install node modules
run: npm install --also=dev

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

- name: Update Changelog
run: hatch run build:git-cliff -o CHANGELOG.md

- name: package
run: hatch run build:package

Expand All @@ -181,6 +208,23 @@ jobs:
name: wheel-package
path: dist/*.whl

- name: Prepare IntelliJ Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/intellij-client/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
# Store already-built plugin as an artifact for downloading
- name: Upload IntelliJ plugin
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./intellij-client/build/distributions/content/*/*

publish:
runs-on: ubuntu-latest
needs: package
Expand Down
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body = """
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [unreleased]
## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ exclude = [
"^playground/",
"^scripts/",
"^bundled/libs/",
"^intellij-client/",
]
mypy_path = [
"typings",
Expand Down
3 changes: 3 additions & 0 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def main() -> None:
check=False,
).check_returncode()

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


if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions scripts/update_git_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ def main() -> None:
rf"\g<1>{version or ''}\g<3>",
)

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


if __name__ == "__main__":
main()

0 comments on commit 6cd6486

Please sign in to comment.