Skip to content

Commit f118f14

Browse files
authored
fix: Fixing Publish Workflow (#1040)
Signed-off-by: Alfredo Gutierrez Grajeda <[email protected]>
1 parent 6b01ead commit f118f14

File tree

1 file changed

+96
-12
lines changed

1 file changed

+96
-12
lines changed

.github/workflows/release-push-image.yaml

+96-12
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ env:
3131
PACKAGE_NAME: hedera-block-node
3232
REGISTRY: ghcr.io
3333
GRADLE_EXEC: "ionice -c 2 -n 2 nice -n 19 ./gradlew "
34+
JAVA_DISTRIBUTION: "temurin"
35+
JAVA_VERSION: "21.0.6"
36+
DOCKER_MIRROR: "https://hub.mirror.docker.lat.ope.eng.hashgraph.io"
37+
BUILDKIT_VERSION: "v0.22.0"
3438

3539
jobs:
3640
check-gradle:
@@ -41,7 +45,7 @@ jobs:
4145
java-distribution: ${{ inputs.java-distribution || 'temurin' }}
4246
java-version: ${{ inputs.java-version || '21.0.6' }}
4347

44-
publish:
48+
publish-block-node-app:
4549
timeout-minutes: 30
4650
needs: [check-gradle]
4751
runs-on: hiero-block-node-linux-medium
@@ -60,11 +64,11 @@ jobs:
6064
- name: Install JDK
6165
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
6266
with:
63-
distribution: "temurin"
64-
java-version: "21.0.6"
67+
distribution: ${{ env.JAVA_DISTRIBUTION }}
68+
java-version: ${{ env.JAVA_VERSION }}
6569

6670
- name: Build
67-
run: ${GRADLE_EXEC} clean build
71+
run: ${GRADLE_EXEC} clean assemble
6872

6973
- name: Login to GitHub Container Registry
7074
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
@@ -82,7 +86,8 @@ jobs:
8286
driver-opts: network=host
8387
buildkitd-config-inline: |
8488
[registry."docker.io"]
85-
mirrors = ["https://hub.mirror.docker.lat.ope.eng.hashgraph.io"]
89+
mirrors = ["${{ env.DOCKER_MIRROR }}"]
90+
version: ${{ env.BUILDKIT_VERSION }}
8691

8792
- name: Extract version
8893
id: extract_version
@@ -99,8 +104,8 @@ jobs:
99104
- name: Server - Build and push image
100105
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
101106
with:
102-
context: ./block-node/server/docker
103-
file: ./block-node/server/docker/Dockerfile
107+
context: ./block-node/app/docker
108+
file: ./block-node/app/docker/Dockerfile
104109
cache-from: type=gha
105110
cache-to: type=gha,mode=max
106111
platforms: linux/amd64, linux/arm64
@@ -110,10 +115,59 @@ jobs:
110115
VERSION=${{ env.VERSION }}
111116
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
112117
build-contexts: |
113-
distributions=./block-node/server/build/distributions
118+
distributions=./block-node/app/build/distributions
114119
115-
# Build and push SIMULATOR image
120+
publish-simulator:
121+
timeout-minutes: 30
122+
needs: [check-gradle]
123+
runs-on: hiero-block-node-linux-medium
124+
125+
steps:
126+
- name: Harden Runner
127+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
128+
with:
129+
egress-policy: audit
130+
131+
- name: Checkout repository
132+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
133+
with:
134+
fetch-depth: 0
135+
136+
- name: Install JDK
137+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
138+
with:
139+
distribution: ${{ env.JAVA_DISTRIBUTION }}
140+
java-version: ${{ env.JAVA_VERSION }}
116141

142+
- name: Build
143+
run: ${GRADLE_EXEC} clean assemble
144+
145+
- name: Login to GitHub Container Registry
146+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
147+
with:
148+
registry: ${{ env.REGISTRY }}
149+
username: ${{ github.actor }}
150+
password: ${{ secrets.GITHUB_TOKEN }}
151+
152+
- name: Set up Docker Qemu
153+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
154+
155+
- name: Set up Docker Buildx
156+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
157+
with:
158+
driver-opts: network=host
159+
buildkitd-config-inline: |
160+
[registry."docker.io"]
161+
mirrors = ["${{ env.DOCKER_MIRROR }}"]
162+
version: ${{ env.BUILDKIT_VERSION }}
163+
164+
- name: Extract version
165+
id: extract_version
166+
run: |
167+
VERSION=$(cat version.txt)
168+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
169+
170+
# Build and push SIMULATOR image
117171
- name: Simulator - Prepare docker directory
118172
run: |
119173
${GRADLE_EXEC} :simulator:copyDependenciesFolders
@@ -122,7 +176,7 @@ jobs:
122176
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
123177
with:
124178
context: ./simulator/build/docker
125-
file: ./simulator/docker/Dockerfile
179+
file: ./simulator/build/docker/Dockerfile
126180
cache-from: type=gha
127181
cache-to: type=gha,mode=max
128182
platforms: linux/amd64, linux/arm64
@@ -131,9 +185,9 @@ jobs:
131185
build-args: |
132186
VERSION=${{ env.VERSION }}
133187
134-
helm-chart-release:
188+
helm-chart-release-block-node-app:
135189
timeout-minutes: 15
136-
needs: publish
190+
needs: publish-block-node-app
137191
runs-on: hiero-block-node-linux-medium
138192

139193
steps:
@@ -170,6 +224,36 @@ jobs:
170224
run: |
171225
helm push block-node-helm-chart-${{ env.VERSION }}.tgz oci://ghcr.io/hiero-ledger/hiero-block-node
172226
227+
helm-chart-release-simulator:
228+
timeout-minutes: 15
229+
needs: publish-simulator
230+
runs-on: hiero-block-node-linux-medium
231+
232+
steps:
233+
- name: Harden Runner
234+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
235+
with:
236+
egress-policy: audit
237+
238+
- name: Checkout repository
239+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
240+
241+
- name: Install Helm
242+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
243+
244+
- name: Login to GitHub Container Registry
245+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
246+
with:
247+
registry: ${{ env.REGISTRY }}
248+
username: ${{ github.actor }}
249+
password: ${{ secrets.GITHUB_TOKEN }}
250+
251+
- name: Extract version
252+
id: extract_version
253+
run: |
254+
VERSION=$(cat version.txt)
255+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
256+
173257
- name: Simulator Chart - Package helm chart
174258
run: |
175259
helm dependency update charts/blockstream-simulator

0 commit comments

Comments
 (0)