Skip to content

Commit b61d35a

Browse files
committed
Add template data
1 parent 4ff500a commit b61d35a

17 files changed

+1038
-1
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ updates:
1313
update-types:
1414
- "version-update:semver-minor"
1515
- "version-update:semver-patch"
16-
- package-ecosystem: maven
16+
- package-ecosystem: gradle
1717
directory: "/"
1818
schedule:
1919
interval: daily

.github/workflows/checkBuild.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Check Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- '.config/**'
10+
- '.idea/**'
11+
- 'assets/**'
12+
pull_request:
13+
branches: [ develop ]
14+
paths-ignore:
15+
- '**.md'
16+
- '.config/**'
17+
- '.idea/**'
18+
- 'assets/**'
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
matrix:
26+
java: [17, 21]
27+
distribution: [temurin]
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up JDK
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: ${{ matrix.distribution }}
36+
java-version: ${{ matrix.java }}
37+
cache: 'gradle'
38+
39+
- name: Build
40+
run: ./gradlew build buildPlugin --info
41+
42+
- name: Try upload test reports when failure occurs
43+
uses: actions/upload-artifact@v4
44+
if: failure()
45+
with:
46+
name: test-reports-${{ matrix.java }}
47+
path: build/reports/tests/test/**
48+
49+
- name: Check for uncommited changes
50+
run: |
51+
if [[ "$(git status --porcelain)" != "" ]]; then
52+
echo ----------------------------------------
53+
echo git status
54+
echo ----------------------------------------
55+
git status
56+
echo ----------------------------------------
57+
echo git diff
58+
echo ----------------------------------------
59+
git diff
60+
echo ----------------------------------------
61+
echo Troubleshooting
62+
echo ----------------------------------------
63+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package"
64+
exit 1
65+
fi
66+
67+
- name: Upload plugin files
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: plugin-files-java-${{ matrix.java }}
71+
path: build/libs/intellij-plugin-template-*.jar
72+
if-no-files-found: error
73+
74+
code-style:
75+
runs-on: ubuntu-latest
76+
77+
strategy:
78+
matrix:
79+
java: [17]
80+
distribution: [temurin]
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Set up JDK
86+
uses: actions/setup-java@v4
87+
with:
88+
distribution: ${{ matrix.distribution }}
89+
java-version: ${{ matrix.java }}
90+
cache: 'gradle'
91+
92+
- name: Run Checkstyle
93+
run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled=true
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Check IDE Compatibility
2+
3+
on:
4+
schedule:
5+
- cron: '55 2 * * 1'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-ide-compatibility:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
java: [17]
15+
distribution: [temurin]
16+
platformType: [IC]
17+
platformVersion: [LATEST-EAP-SNAPSHOT]
18+
19+
steps:
20+
- name: Free up disk space
21+
run: |
22+
sudo df -h
23+
sudo docker system prune -af || true
24+
sudo rm -rf /usr/share/dotnet \
25+
/usr/local/.ghcup \
26+
/usr/local/swift \
27+
/usr/share/swift \
28+
/usr/lib/jvm \
29+
/usr/local/lib/android \
30+
/usr/lib/google-cloud-sdk \
31+
/usr/local/share/boost \
32+
/usr/local/share/powershell \
33+
/usr/local/share/chromium \
34+
/usr/local/lib/node_modules \
35+
/usr/lib/mono \
36+
/usr/lib/heroku \
37+
/usr/lib/firefox \
38+
/usr/share/miniconda \
39+
/opt/microsoft \
40+
/opt/chrome \
41+
/opt/pipx \
42+
"$AGENT_TOOLSDIRECTORY" || true
43+
sudo df -h
44+
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up JDK
48+
uses: actions/setup-java@v4
49+
with:
50+
distribution: ${{ matrix.distribution }}
51+
java-version: ${{ matrix.java }}
52+
53+
- name: Check compatibility
54+
run: ./gradlew runPluginVerifier -PplatformVersion=LATEST-EAP-SNAPSHOT --info

.github/workflows/release.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
check_code: # Validates the code
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: 'gradle'
23+
24+
- name: Build
25+
run: ./gradlew build buildPlugin --info
26+
27+
- name: Check for uncommited changes
28+
run: |
29+
if [[ "$(git status --porcelain)" != "" ]]; then
30+
echo ----------------------------------------
31+
echo git status
32+
echo ----------------------------------------
33+
git status
34+
echo ----------------------------------------
35+
echo git diff
36+
echo ----------------------------------------
37+
git diff
38+
echo ----------------------------------------
39+
echo Troubleshooting
40+
echo ----------------------------------------
41+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package"
42+
exit 1
43+
fi
44+
45+
prepare_release:
46+
runs-on: ubuntu-latest
47+
needs: [check_code]
48+
outputs:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Configure Git
54+
run: |
55+
git config --global user.email "[email protected]"
56+
git config --global user.name "GitHub Actions"
57+
58+
- name: UN-Snap version and output
59+
id: version
60+
run: |
61+
originalVersion=$(grep -Po 'pluginVersion=\K.*' gradle.properties)
62+
newVersion="$(echo $originalVersion | cut -d '-' -f1)"
63+
echo "New version: $newVersion"
64+
sed -i "s/pluginVersion=$originalVersion/pluginVersion=$newVersion/" gradle.properties
65+
66+
version=$newVersion
67+
echo "release=$version" >> $GITHUB_OUTPUT
68+
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
69+
70+
echo "Contents of gradle.properties"
71+
cat gradle.properties
72+
73+
- name: Commit and Push
74+
run: |
75+
git add -A
76+
git commit -m "Release ${{ steps.version.outputs.release }}"
77+
git push origin
78+
git tag v${{ steps.version.outputs.release }}
79+
git push origin --tags
80+
81+
- name: Create Release
82+
id: create_release
83+
uses: shogo82148/actions-create-release@v1
84+
with:
85+
tag_name: v${{ steps.version.outputs.release }}
86+
release_name: v${{ steps.version.outputs.release }}
87+
commitish: master
88+
body: |
89+
## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
90+
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
91+
92+
## Installation
93+
The plugin is listed on the [Marketplace](https://plugins.jetbrains.com/plugin/pluginId).
94+
95+
Open the plugin Marketplace in your IDE (``File > Settings > Plugins > Marketplace``), search for the plugin and hit the install button.
96+
97+
Alternatively you can also download the jar from the marketplace website.
98+
99+
publish:
100+
runs-on: ubuntu-latest
101+
needs: [prepare_release]
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Set up JDK
106+
uses: actions/setup-java@v4
107+
with:
108+
distribution: 'temurin'
109+
java-version: 17
110+
cache: 'gradle'
111+
112+
- name: Init Git and pull
113+
run: |
114+
git config --global user.email "[email protected]"
115+
git config --global user.name "GitHub Actions"
116+
git pull
117+
118+
- name: Publish Plugin
119+
env:
120+
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_PUBLISH_TOKEN }}
121+
CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_MARKETPLACE_CERTIFICATE_CHAIN }}
122+
PRIVATE_KEY: ${{ secrets.JETBRAINS_MARKETPLACE_PRIVATE_KEY }}
123+
PRIVATE_KEY_PASSWORD: ${{ secrets.JETBRAINS_MARKETPLACE_PRIVATE_KEY_PASSWORD }}
124+
run: ./gradlew publishPlugin --info --stacktrace
125+
126+
- name: Upload plugin files
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: plugin-files
130+
path: build/distributions/*
131+
132+
after_release:
133+
runs-on: ubuntu-latest
134+
needs: [publish]
135+
steps:
136+
- uses: actions/checkout@v4
137+
138+
- name: Init Git and pull
139+
run: |
140+
git config --global user.email "[email protected]"
141+
git config --global user.name "GitHub Actions"
142+
git pull
143+
144+
- name: Inc Version and SNAP root
145+
run: |
146+
originalVersion=$(grep -Po 'pluginVersion=\K.*' gradle.properties)
147+
newVersion="$(echo $originalVersion | cut -d '-' -f1 | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-SNAPSHOT"
148+
echo "New version: $newVersion"
149+
sed -i "s/pluginVersion=$originalVersion/pluginVersion=$newVersion/" gradle.properties
150+
151+
echo "Contents of gradle.properties"
152+
cat gradle.properties
153+
154+
- name: Git Commit and Push
155+
run: |
156+
git add -A
157+
git commit -m "Preparing for next development iteration"
158+
git push origin
159+
160+
- name: pull-request
161+
uses: repo-sync/pull-request@v2
162+
with:
163+
destination_branch: "develop"
164+
pr_title: "Sync back"
165+
pr_body: "An automated PR to sync changes back"

.github/workflows/sonar.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Sonar
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- '.config/**'
10+
- '.idea/**'
11+
- 'assets/**'
12+
pull_request:
13+
types: [opened, synchronize, reopened]
14+
paths-ignore:
15+
- '**.md'
16+
- '.config/**'
17+
- '.idea/**'
18+
- 'assets/**'
19+
20+
env:
21+
SONARCLOUD_ORG: ${{ github.event.organization.login }}
22+
SONARCLOUD_HOST: https://sonarcloud.io
23+
24+
jobs:
25+
sonar:
26+
name: SonarCloud Scan
27+
runs-on: ubuntu-latest
28+
# Dependabot PRs have no access to secrets (SONAR_TOKEN) -> Ignore them
29+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'dependabot/') }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
34+
35+
- name: Set up JDK
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: 'temurin'
39+
java-version: 17
40+
41+
- name: Cache SonarCloud packages
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.sonar/cache
45+
key: ${{ runner.os }}-sonar
46+
restore-keys: ${{ runner.os }}-sonar
47+
48+
- name: Cache Gradle packages
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.gradle/caches
52+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
53+
restore-keys: ${{ runner.os }}-gradle
54+
55+
- name: Build
56+
run: ./gradlew build sonarqube --info -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} -Dsonar.organization=${{ env.SONARCLOUD_ORG }} -Dsonar.host.url=${{ env.SONARCLOUD_HOST }}
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
59+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)