Skip to content

Commit

Permalink
chore: apply workaround for sdk-full release (#1808)
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
Co-authored-by: Roger Barker <roger.barker@swirldslabs.com>
Co-authored-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
  • Loading branch information
4 people authored May 17, 2024
1 parent 8b40b81 commit ac0043e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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."
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ com.hedera.hashgraph.sdk.ContractInfoTest.toProtobuf=[
"memoizedSerializedSize": 0,
"isMutable": false
},
"bitField0_": 27,
"contractID_": {
"memoizedHashCode": 0,
"memoizedSerializedSize": 2147483647,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ com.hedera.hashgraph.sdk.ContractNonceInfoTest.toProtobuf=[
"memoizedSerializedSize": 0,
"isMutable": false
},
"bitField0_": 1,
"contractId_": {
"memoizedHashCode": 0,
"memoizedSerializedSize": 2147483647,
Expand Down

0 comments on commit ac0043e

Please sign in to comment.