generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better browser performance + fixed settings panel + pulled upstr…
…eam plugin template (upgraded gradle and build tools) (#193)
- Loading branch information
1 parent
be1f28e
commit 368dc12
Showing
22 changed files
with
407 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ on: | |
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
# Prepare environment and build the plugin | ||
|
@@ -36,13 +36,13 @@ jobs: | |
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} | ||
steps: | ||
|
||
# Check out current repository | ||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
# Validate wrapper | ||
- name: Gradle Wrapper Validation | ||
uses: gradle/wrapper-validation-action@v3 | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
# Set up Java environment for the next steps | ||
- name: Setup Java | ||
|
@@ -54,8 +54,6 @@ jobs: | |
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Set environment variables | ||
- name: Export Properties | ||
|
@@ -73,8 +71,6 @@ jobs: | |
echo "$CHANGELOG" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier | ||
# Build plugin | ||
- name: Build plugin | ||
run: ./gradlew buildPlugin | ||
|
@@ -104,7 +100,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Check out current repository | ||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -118,8 +114,6 @@ jobs: | |
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Run tests | ||
- name: Run Tests | ||
|
@@ -158,7 +152,7 @@ jobs: | |
tool-cache: false | ||
large-packages: false | ||
|
||
# Check out current repository | ||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -174,7 +168,7 @@ jobs: | |
|
||
# Run Qodana inspections | ||
- name: Qodana - Code Inspection | ||
uses: JetBrains/[email protected].3 | ||
uses: JetBrains/[email protected] | ||
with: | ||
upload-result: true # upload results as github action artifacts | ||
cache-default-branch-only: true | ||
|
@@ -193,7 +187,7 @@ jobs: | |
tool-cache: false | ||
large-packages: false | ||
|
||
# Check out current repository | ||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -207,8 +201,6 @@ jobs: | |
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Cache Plugin Verifier IDEs | ||
- name: Setup Plugin Verifier IDEs Cache | ||
|
@@ -219,7 +211,7 @@ jobs: | |
|
||
# Run Verify Plugin task and IntelliJ Plugin Verifier tool | ||
- name: Run Plugin Verification tasks | ||
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | ||
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | ||
|
||
# Collect Plugin Verifier Result | ||
- name: Collect Plugin Verifier Result | ||
|
@@ -240,7 +232,7 @@ jobs: | |
contents: write | ||
steps: | ||
|
||
# Check out current repository | ||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -264,4 +256,4 @@ jobs: | |
--notes "$(cat << 'EOM' | ||
${{ needs.build.outputs.changelog }} | ||
EOM | ||
)" | ||
)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# GitHub Actions Workflow responsible for cleaning up the IntelliJ Platform Plugin Template repository from the template-specific files and configurations. | ||
# This workflow is supposed to be triggered automatically when a new template-based repository has been created. | ||
|
||
name: Template Cleanup | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
|
||
# Run a cleaning process only if the workflow is triggered by the non-"intellij-platform-plugin-template" repository. | ||
template-cleanup: | ||
name: Template Cleanup | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.name != 'intellij-platform-plugin-template' | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
# Cleanup project | ||
- name: Cleanup | ||
run: | | ||
export LC_CTYPE=C | ||
export LANG=C | ||
# Prepare variables | ||
NAME="${GITHUB_REPOSITORY##*/}" | ||
ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]') | ||
SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') | ||
SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') | ||
GROUP="com.github.$SAFE_ACTOR.$SAFE_NAME" | ||
# Replace placeholders in the template-cleanup files | ||
sed -i "s/%NAME%/$NAME/g" .github/template-cleanup/* | ||
sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" .github/template-cleanup/* | ||
sed -i "s/%GROUP%/$GROUP/g" .github/template-cleanup/* | ||
# Replace template package name in project files with $GROUP | ||
find src -type f -exec sed -i "s/org.jetbrains.plugins.template/$GROUP/g" {} + | ||
find src -type f -exec sed -i "s/IntelliJ Platform Plugin Template/$NAME/g" {} + | ||
find src -type f -exec sed -i "s/JetBrains/$ACTOR/g" {} + | ||
# Move content | ||
mkdir -p src/main/kotlin/${GROUP//.//} | ||
mkdir -p src/test/kotlin/${GROUP//.//} | ||
cp -R .github/template-cleanup/. . | ||
cp -R src/main/kotlin/org/jetbrains/plugins/template/* src/main/kotlin/${GROUP//.//}/ | ||
cp -R src/test/kotlin/org/jetbrains/plugins/template/* src/test/kotlin/${GROUP//.//}/ | ||
# Cleanup | ||
rm -rf \ | ||
.github/ISSUE_TEMPLATE \ | ||
.github/readme \ | ||
.github/template-cleanup \ | ||
.github/workflows/template-cleanup.yml \ | ||
.github/workflows/template-verify.yml \ | ||
.idea/icon.png \ | ||
src/main/kotlin/org \ | ||
src/test/kotlin/org \ | ||
CODE_OF_CONDUCT.md \ | ||
LICENSE | ||
# Commit modified files | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Template cleanup" | ||
# Push changes | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# GitHub Actions Workflow verifies if the template repository is consistent with all provided content. | ||
|
||
name: Template Verify | ||
on: | ||
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests) | ||
push: | ||
branches: [main] | ||
paths: ['**/gradle.properties'] | ||
# Trigger the workflow on any pull request | ||
pull_request: | ||
paths: ['**/gradle.properties'] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Template Verify | ||
if: github.event.repository.name == 'intellij-platform-plugin-template' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.properties.outputs.version }} | ||
changelog: ${{ steps.properties.outputs.changelog }} | ||
steps: | ||
|
||
# Check out the current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
# Compare `gradle.properties` with `.github/template-cleanup/gradle.properties` | ||
- name: Verify gradle.properties | ||
run: | | ||
echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY | ||
diff -U 0 \ | ||
-I '^pluginVersion' \ | ||
-I '^pluginGroup' \ | ||
-I '^pluginName' \ | ||
-I '^pluginRepositoryUrl' \ | ||
--label .github/template-cleanup/gradle.properties \ | ||
--label gradle.properties \ | ||
.github/template-cleanup/gradle.properties gradle.properties \ | ||
>> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
Oops, something went wrong.