From ac0043e7303cd68b95b58d464e987323af34db41 Mon Sep 17 00:00:00 2001 From: Iliya Savov <117984128+isavov@users.noreply.github.com> Date: Sat, 18 May 2024 02:29:45 +0300 Subject: [PATCH] chore: apply workaround for sdk-full release (#1808) Signed-off-by: Iliya Savov Signed-off-by: Roger Barker Signed-off-by: Nikita Lebedev Co-authored-by: Iliya Savov Co-authored-by: Roger Barker Co-authored-by: Nikita Lebedev --- .github/workflows/release-artifacts.yml | 35 +++++++++++++++++++ sdk/build.gradle | 2 +- .../hashgraph/sdk/ContractInfoTest.snap | 1 - .../hashgraph/sdk/ContractNonceInfoTest.snap | 1 - 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index fcbd721ca..270ceea7c 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -4,6 +4,12 @@ on: push: tags: - 'v*.*.*' + workflow_dispatch: + inputs: + version: + type: string + description: Test Version String (No release to Maven Central) + required: true defaults: run: @@ -32,9 +38,15 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Retrieve Tag Version + if: ${{ github.event_name == 'push' }} id: tag run: echo "version=${GITHUB_REF#refs/tags/v}" >> "${GITHUB_OUTPUT}" + - name: Retrieve Tag Version (workflow_dispatch) + if: ${{ github.event_name == 'workflow_dispatch' }} + id: workflow_tag + run: echo "version=${{github.event.inputs.version}}" >> "${GITHUB_OUTPUT}" + - name: Setup Java uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: @@ -51,6 +63,7 @@ jobs: run: echo "version=$(./gradlew -q showVersion | tr -d '[:space:]')" >> "${GITHUB_OUTPUT}" - name: Validate Release + if: ${{ github.event_name == 'push' }} run: | if [[ "${{ steps.tag.outputs.version }}" != "${{ steps.project.outputs.version }}" ]]; then echo "::error file=version.gradle,line=5,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.gradle' file before tagging." @@ -64,6 +77,7 @@ jobs: # This needs clause exists solely to provide a dependency on the previous step. This publish step will not occur # until the validate-release step completes successfully. - validate-release + steps: - name: Harden Runner uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 @@ -110,4 +124,25 @@ jobs: run: ./gradlew assemble :sdk:javadoc -Dfile.encoding=UTF-8 --scan - name: Nexus Release + if: ${{ github.event_name == 'push' }} run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + + - name: Nexus Release (workflow_dispatch) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: ./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + + - name: Nexus Release sdk-full artifacts + if: ${{ github.event_name == 'push' }} + run: | + # This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged + sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle + git clean -fdx + ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} + + - name: Nexus Release sdk-full artifacts (workflow_dispatch) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + # This is a temporary fix and should be removed once https://github.com/hashgraph/hedera-sdk-java/pull/1732 is merged + sed -i 's#sdk\.gradle#sdk-full.gradle#g' sdk/build.gradle + git clean -fdx + ./gradlew publishToSonatype closeSonatypeStagingRepository --no-parallel -Dfile.encoding=UTF-8 --scan -PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} -PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} diff --git a/sdk/build.gradle b/sdk/build.gradle index f4ecf5185..56bdfed06 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -63,7 +63,7 @@ dependencies { // https://github.com/google/protobuf-gradle-plugin protobuf { protoc { - artifact = "com.google.protobuf:protoc:3.24.3" + artifact = "com.google.protobuf:protoc:3.23.4" } plugins { grpc { diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap index 5875fdf23..af3e6e448 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap @@ -24,7 +24,6 @@ com.hedera.hashgraph.sdk.ContractInfoTest.toProtobuf=[ "memoizedSerializedSize": 0, "isMutable": false }, - "bitField0_": 27, "contractID_": { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647, diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap index 1e1cc8e76..53e34851f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap @@ -24,7 +24,6 @@ com.hedera.hashgraph.sdk.ContractNonceInfoTest.toProtobuf=[ "memoizedSerializedSize": 0, "isMutable": false }, - "bitField0_": 1, "contractId_": { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647,