From 7e56b3cad7c1c91a7818b6c3e699edcb145f0593 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Tue, 3 Oct 2023 20:11:50 +0800 Subject: [PATCH] get version from GITHUB_REF_NAME --- .github/workflows/gradle.yml | 7 ++++--- build.gradle | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c7f3fd7fe..c612e9dae 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 diff --git a/build.gradle b/build.gradle index 8165f9a07..05f29255d 100644 --- a/build.gradle +++ b/build.gradle @@ -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')