diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fb341c30..5e0dbd79e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,20 @@ on: jobs: release: runs-on: ubuntu-latest - container: - image: adoptopenjdk/openjdk11:jdk-11.0.10_9 steps: - name: Check out code - uses: actions/checkout@v3 - + uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: 'gradle' - name: Install necessary tooling env: APACHE_THRIFT_VERSION: 0.9.3 run: | - apt-get update &&apt-get install -y wget gcc make build-essential git + apt-get update && apt-get install -y wget gcc make build-essential git wget https://archive.apache.org/dist/thrift/${APACHE_THRIFT_VERSION}/thrift-${APACHE_THRIFT_VERSION}.tar.gz && \ tar -xvf thrift-${APACHE_THRIFT_VERSION}.tar.gz && \ @@ -40,9 +43,7 @@ jobs: - name: Determine release version id: vars run: | - # Read version from build.gradle - RELEASE_VERSION=$(grep -E 'version\s*=' build.gradle | sed "s/[[:space:]]*version[[:space:]]*=[[:space:]]*'\(.*\)'/\1/") - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + ./gradlew -q printVersion - name: Publish to Sonatype OSSRH (Maven Central) env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c6ce42c..77c0f4963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,7 @@ - Fixed NullPointerException in ContextPropagation when Header is present but fields is null ## 3.11.0 -- Added opentracing support in workflow lifecycles #876 +- Added opentracing support in workflow lifecycles #876 ## 3.10.1 - Fixed the bug: workflow already started for migration @@ -121,12 +121,12 @@ - Add CadenceChangeVersion support. - Allow using other tags in metric reporter. - Add metric tag to differentiate long-poll and normal request. -### Changed +### Changed - Fix identity for sticky worker. - Improve contributing guide. ## 3.5.0 -### Changed +### Changed - Fix consistent query interface which caused overloading ambiguity with variable argument ## 3.4.0 @@ -318,5 +318,3 @@ to disable use FactoryOptions.disableStickyExecution property. - Side effects, mutable side effects, random uuid and workflow getVersion support. - Activity heartbeat throttling. - Deterministic retry of failed operation. - - diff --git a/build.gradle b/build.gradle index fc35af8e6..8cb5369be 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,22 @@ googleJavaFormat { tasks.googleJavaFormat.dependsOn 'license' group = 'com.uber.cadence' -version = '3.12.7-SNAPSHOT' + +version = getVersion() + +def getVersion() { + try { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags' + standardOutput = stdout + } + def gitTag = stdout.toString().trim().replaceFirst("^v", "") + return gitTag + } catch (Exception e) { + return "0.0.0-LOCAL" + } +} description = '''Uber Cadence Java Client''' @@ -96,6 +111,10 @@ license { excludes(["**/*.json", "**/idls","com/uber/cadence/*.java", "com/uber/cadence/shadower/*.java"]) // config files and generated code } +task printVersion { + println "current version: $version" +} + task initDlsSubmodule(type: Exec) { description = 'Initializes src/main/idls submodule' commandLine 'git', 'submodule', 'init'