Skip to content

Commit

Permalink
refact: set plugin version from tag name during releases
Browse files Browse the repository at this point in the history
  • Loading branch information
bjansen committed Mar 31, 2023
1 parent df159cd commit 5b292fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
- IDEA_VERSION: IC-2020.3 # Oldest supported version
SINCE_VERSION: 203
UNTIL_VERSION: 210.*
ARTIFACT_SUFFIX: "-2020"
VERSION_SUFFIX: "-2020"
- IDEA_VERSION: IC-2021.3.3
SINCE_VERSION: 210
UNTIL_VERSION: 220.*
ARTIFACT_SUFFIX: "-2021"
VERSION_SUFFIX: "-2021"
- IDEA_VERSION: IC-2022.3.3
SINCE_VERSION: 220
UNTIL_VERSION: 230.*
ARTIFACT_SUFFIX: "-2022"
VERSION_SUFFIX: "-2022"
JDK_VERSION: 17
- IDEA_VERSION: IC-2023.1
SINCE_VERSION: 230
JDK_VERSION: 17
ARTIFACT_SUFFIX:
VERSION_SUFFIX:

steps:
- uses: actions/checkout@v3
Expand All @@ -52,17 +52,11 @@ jobs:

- name: Build with Gradle
run: |
./gradlew -PideaVersion=${IDEA_VERSION} -PsinceBuildVersion=${SINCE_VERSION} -PuntilBuildVersion=${UNTIL_VERSION} check buildPlugin
env: ${{ matrix.env }}

- name: Rename artifact
if: matrix.env.ARTIFACT_SUFFIX != ''
run: |
for f in `find build/distributions/ -name 'antlr-intellij-plugin-v4-*.zip'`; do mv -- "$f" "${f%.zip}${ARTIFACT_SUFFIX}.zip"; done
./gradlew -PideaVersion=${IDEA_VERSION} -PsinceBuildVersion=${SINCE_VERSION} -PuntilBuildVersion=${UNTIL_VERSION} -PpluginVersion=${GITHUB_REF_NAME}${VERSION_SUFFIX} check buildPlugin
env: ${{ matrix.env }}

- name: Archive distribution artifact
uses: actions/upload-artifact@v3
with:
name: "antlr-intellij${{matrix.env.ARTIFACT_SUFFIX}}"
name: "antlr-intellij${{matrix.env.VERSION_SUFFIX}}"
path: build/distributions/antlr-intellij-plugin-v4-*.zip
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pluginVersion=1.20
# Overridden by Gradle during releases
pluginVersion=next-SNAPSHOT

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

0 comments on commit 5b292fe

Please sign in to comment.