Skip to content

Commit 72c72bd

Browse files
committed
Merge branch 'master' into update-from-template-merged
2 parents 27fddce + 9cafca2 commit 72c72bd

19 files changed

+1226
-2
lines changed

.github/workflows/check-build.yml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Check Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
- '.config/**'
10+
- '.github/**'
11+
- '.idea/**'
12+
- 'assets/**'
13+
pull_request:
14+
branches: [ develop ]
15+
paths-ignore:
16+
- '**.md'
17+
- '.config/**'
18+
- '.github/**'
19+
- '.idea/**'
20+
- 'assets/**'
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 30
26+
27+
strategy:
28+
matrix:
29+
java: [21]
30+
distribution: [temurin]
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up JDK
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: ${{ matrix.distribution }}
39+
java-version: ${{ matrix.java }}
40+
cache: 'gradle'
41+
42+
- name: Build
43+
run: ./gradlew build buildPlugin --info --stacktrace
44+
45+
- name: Try upload test reports when failure occurs
46+
uses: actions/upload-artifact@v4
47+
if: failure()
48+
with:
49+
name: test-reports-${{ matrix.java }}
50+
path: build/reports/tests/test/**
51+
52+
- name: Check for uncommited changes
53+
run: |
54+
if [[ "$(git status --porcelain)" != "" ]]; then
55+
echo ----------------------------------------
56+
echo git status
57+
echo ----------------------------------------
58+
git status
59+
echo ----------------------------------------
60+
echo git diff
61+
echo ----------------------------------------
62+
git diff
63+
echo ----------------------------------------
64+
echo Troubleshooting
65+
echo ----------------------------------------
66+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean package"
67+
exit 1
68+
fi
69+
70+
- name: Upload plugin files
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: plugin-files-java-${{ matrix.java }}
74+
path: build/libs/template-placeholder-*.jar
75+
if-no-files-found: error
76+
77+
checkstyle:
78+
runs-on: ubuntu-latest
79+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
80+
timeout-minutes: 15
81+
82+
strategy:
83+
matrix:
84+
java: [21]
85+
distribution: [temurin]
86+
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Set up JDK
91+
uses: actions/setup-java@v4
92+
with:
93+
distribution: ${{ matrix.distribution }}
94+
java-version: ${{ matrix.java }}
95+
cache: 'gradle'
96+
97+
- name: Run Checkstyle
98+
run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled --stacktrace
99+
100+
pmd:
101+
runs-on: ubuntu-latest
102+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
103+
timeout-minutes: 15
104+
105+
strategy:
106+
matrix:
107+
java: [21]
108+
distribution: [temurin]
109+
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- name: Set up JDK
114+
uses: actions/setup-java@v4
115+
with:
116+
distribution: ${{ matrix.distribution }}
117+
java-version: ${{ matrix.java }}
118+
cache: 'gradle'
119+
120+
- name: Run PMD
121+
run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace
122+
123+
- name: Upload report
124+
if: always()
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: pmd-report
128+
if-no-files-found: ignore
129+
path: |
130+
build/reports/pmd/*.html
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+
timeout-minutes: 45
12+
steps:
13+
- name: Free up disk space
14+
run: |
15+
sudo df -h
16+
sudo docker system prune -af || true
17+
sudo rm -rf /usr/share/dotnet \
18+
/usr/local/.ghcup \
19+
/usr/local/swift \
20+
/usr/share/swift \
21+
/usr/lib/jvm \
22+
/usr/local/lib/android \
23+
/usr/lib/google-cloud-sdk \
24+
/usr/local/share/boost \
25+
/usr/local/share/powershell \
26+
/usr/local/share/chromium \
27+
/usr/local/lib/node_modules \
28+
/usr/lib/mono \
29+
/usr/lib/heroku \
30+
/usr/lib/firefox \
31+
/usr/share/miniconda \
32+
/opt/microsoft \
33+
/opt/chrome \
34+
/opt/pipx \
35+
"$AGENT_TOOLSDIRECTORY" || true
36+
sudo df -h
37+
38+
- uses: actions/checkout@v4
39+
40+
- name: Set up JDK
41+
uses: actions/setup-java@v4
42+
with:
43+
distribution: 'temurin'
44+
java-version: 21
45+
46+
- name: Check compatibility
47+
run: ./gradlew verifyPlugin --info --stacktrace
48+
49+
- name: Upload report
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: plugin-verifier-reports
53+
path: build/reports/pluginVerifier/**
54+
if-no-files-found: warn

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)