get version from GITHUB_REF_NAME (#605)

This commit is contained in:
Bob Pan 2023-10-03 21:03:25 +08:00 committed by GitHub
parent 9510b74dca
commit b5bda4fb49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -24,11 +24,12 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
- name: Build dex-tools with Gradle
run: ./gradlew check distZip
run: |
./gradlew "-DGITHUB_REF_NAME=${GITHUB_REF_NAME}" check distZip
- name: Archive dex tools
uses: actions/upload-artifact@v3
if: success()
with:
name: dex-tools-2.2-SNAPSHOT
path: dex-tools/build/distributions/dex-tools-2.2-SNAPSHOT.zip
name: dex-tools
path: dex-tools/build/distributions/dex-tools-*.zip

View File

@ -3,7 +3,7 @@ allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.googlecode.d2j'
version = '2.2-SNAPSHOT'
version = System.getProperty('GITHUB_REF_NAME', '2.x').replaceAll('[/ ]','-')
}
defaultTasks('clean','distZip')