Skip to content

Commit 5b292fe

Browse files
committed
refact: set plugin version from tag name during releases
1 parent df159cd commit 5b292fe

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ jobs:
2020
- IDEA_VERSION: IC-2020.3 # Oldest supported version
2121
SINCE_VERSION: 203
2222
UNTIL_VERSION: 210.*
23-
ARTIFACT_SUFFIX: "-2020"
23+
VERSION_SUFFIX: "-2020"
2424
- IDEA_VERSION: IC-2021.3.3
2525
SINCE_VERSION: 210
2626
UNTIL_VERSION: 220.*
27-
ARTIFACT_SUFFIX: "-2021"
27+
VERSION_SUFFIX: "-2021"
2828
- IDEA_VERSION: IC-2022.3.3
2929
SINCE_VERSION: 220
3030
UNTIL_VERSION: 230.*
31-
ARTIFACT_SUFFIX: "-2022"
31+
VERSION_SUFFIX: "-2022"
3232
JDK_VERSION: 17
3333
- IDEA_VERSION: IC-2023.1
3434
SINCE_VERSION: 230
3535
JDK_VERSION: 17
36-
ARTIFACT_SUFFIX:
36+
VERSION_SUFFIX:
3737

3838
steps:
3939
- uses: actions/checkout@v3
@@ -52,17 +52,11 @@ jobs:
5252

5353
- name: Build with Gradle
5454
run: |
55-
./gradlew -PideaVersion=${IDEA_VERSION} -PsinceBuildVersion=${SINCE_VERSION} -PuntilBuildVersion=${UNTIL_VERSION} check buildPlugin
56-
env: ${{ matrix.env }}
57-
58-
- name: Rename artifact
59-
if: matrix.env.ARTIFACT_SUFFIX != ''
60-
run: |
61-
for f in `find build/distributions/ -name 'antlr-intellij-plugin-v4-*.zip'`; do mv -- "$f" "${f%.zip}${ARTIFACT_SUFFIX}.zip"; done
55+
./gradlew -PideaVersion=${IDEA_VERSION} -PsinceBuildVersion=${SINCE_VERSION} -PuntilBuildVersion=${UNTIL_VERSION} -PpluginVersion=${GITHUB_REF_NAME}${VERSION_SUFFIX} check buildPlugin
6256
env: ${{ matrix.env }}
6357

6458
- name: Archive distribution artifact
6559
uses: actions/upload-artifact@v3
6660
with:
67-
name: "antlr-intellij${{matrix.env.ARTIFACT_SUFFIX}}"
61+
name: "antlr-intellij${{matrix.env.VERSION_SUFFIX}}"
6862
path: build/distributions/antlr-intellij-plugin-v4-*.zip

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
pluginVersion=1.20
1+
# Overridden by Gradle during releases
2+
pluginVersion=next-SNAPSHOT
23

34
# e.g. IC-2016.3.3, IU-2018.2.5 etc
45
# For a list of possible values, refer to the section 'com.jetbrains.intellij.idea' at

0 commit comments

Comments
 (0)