Skip to content

Commit bcaf5a2

Browse files
authored
ci: 💚 Remove release CI and use existing jobs (#546)
1 parent 1460067 commit bcaf5a2

File tree

2 files changed

+53
-213
lines changed

2 files changed

+53
-213
lines changed

.github/workflows/network.yml

Lines changed: 53 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ on:
2323
push:
2424
branches: [main]
2525
workflow_dispatch:
26+
inputs:
27+
image_tag:
28+
description: "Docker image tag to publish (e.g., v0.1.0)"
29+
required: false
30+
type: string
31+
release:
32+
types: [published]
2633

2734
jobs:
2835
setup:
@@ -46,6 +53,10 @@ jobs:
4653
- name: Check if the node needs rebuild
4754
id: node_check
4855
run: |
56+
if [[ "${{ github.event_name }}" == "release" ]]; then
57+
echo "changed=false" >> $GITHUB_OUTPUT
58+
exit 0
59+
fi
4960
BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}"
5061
HEAD_SHA="${{ github.sha }}"
5162
@@ -58,6 +69,10 @@ jobs:
5869
- name: Check if the MSP backend needs rebuild
5970
id: backend_check
6071
run: |
72+
if [[ "${{ github.event_name }}" == "release" ]]; then
73+
echo "changed=false" >> $GITHUB_OUTPUT
74+
exit 0
75+
fi
6176
BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}"
6277
HEAD_SHA="${{ github.sha }}"
6378
@@ -70,7 +85,11 @@ jobs:
7085
- name: Set tag names for publishing
7186
id: set-tag
7287
run: |
73-
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
88+
if [[ "${{ github.event_name }}" == 'release' ]]; then
89+
echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
90+
elif [[ "${{ github.event_name }}" == 'workflow_dispatch' && -n "${{ inputs.image_tag }}" ]]; then
91+
echo "tag=${{ inputs.image_tag }}" >> $GITHUB_OUTPUT
92+
elif [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
7493
echo "tag=latest" >> $GITHUB_OUTPUT
7594
elif [[ "${{ env.SKIP_BUILD_LABEL_PRESENT }}" == "true" && "${{ env.SKIP_BACKEND_BUILD_LABEL_PRESENT }}" == "true" ]]; then
7695
echo "tag=latest" >> $GITHUB_OUTPUT
@@ -82,17 +101,25 @@ jobs:
82101
- name: Set flags
83102
id: flags
84103
run: |
85-
echo "force_node=${{ env.FORCE_NODE_PUBLISH_LABEL_PRESENT }}" >> $GITHUB_OUTPUT
86-
echo "force_backend=${{ env.FORCE_BACKEND_PUBLISH_LABEL_PRESENT }}" >> $GITHUB_OUTPUT
104+
if [[ "${{ github.event_name }}" == 'release' ]]; then
105+
echo "force_node=false" >> $GITHUB_OUTPUT
106+
echo "force_backend=true" >> $GITHUB_OUTPUT
107+
elif [[ "${{ github.event_name }}" == 'workflow_dispatch' && -n "${{ inputs.image_tag }}" ]]; then
108+
echo "force_node=false" >> $GITHUB_OUTPUT
109+
echo "force_backend=true" >> $GITHUB_OUTPUT
110+
else
111+
echo "force_node=${{ env.FORCE_NODE_PUBLISH_LABEL_PRESENT }}" >> $GITHUB_OUTPUT
112+
echo "force_backend=${{ env.FORCE_BACKEND_PUBLISH_LABEL_PRESENT }}" >> $GITHUB_OUTPUT
113+
fi
87114
88115
build_node:
89116
needs: [setup]
90-
name: 'Build node binary if changed'
117+
name: "Build node binary if changed"
91118
runs-on: blacksmith-16vcpu-ubuntu-2404
92119
env:
93-
SCCACHE_GHA_ENABLED: 'true'
94-
RUSTC_WRAPPER: 'sccache'
95-
CARGO_INCREMENTAL: '0'
120+
SCCACHE_GHA_ENABLED: "true"
121+
RUSTC_WRAPPER: "sccache"
122+
CARGO_INCREMENTAL: "0"
96123
CARGO_TERM_COLOR: always
97124
steps:
98125
- uses: actions/checkout@v4
@@ -147,12 +174,12 @@ jobs:
147174

148175
build_backend:
149176
needs: [setup]
150-
name: 'Build backend binary if changed'
177+
name: "Build backend binary if changed"
151178
runs-on: blacksmith-16vcpu-ubuntu-2404
152179
env:
153-
SCCACHE_GHA_ENABLED: 'true'
154-
RUSTC_WRAPPER: 'sccache'
155-
CARGO_INCREMENTAL: '0'
180+
SCCACHE_GHA_ENABLED: "true"
181+
RUSTC_WRAPPER: "sccache"
182+
CARGO_INCREMENTAL: "0"
156183
CARGO_TERM_COLOR: always
157184
steps:
158185
- uses: actions/checkout@v4
@@ -201,11 +228,11 @@ jobs:
201228
name: backend
202229
path: build/sh-msp-backend
203230
if-no-files-found: error
204-
231+
205232
push_node_image:
206233
needs: [build_node, setup]
207234
if: needs.setup.outputs.node_changed == 'true' || needs.setup.outputs.force_node == 'true'
208-
name: 'Push node Docker image to Docker Hub'
235+
name: "Push node Docker image to Docker Hub"
209236
runs-on: blacksmith-16vcpu-ubuntu-2404
210237
steps:
211238
- uses: actions/checkout@v4
@@ -245,11 +272,11 @@ jobs:
245272
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
246273
org.opencontainers.image.revision=${{ github.sha }}
247274
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
248-
275+
249276
push_backend_image:
250277
needs: [build_backend, setup]
251278
if: needs.setup.outputs.backend_changed == 'true' || needs.setup.outputs.force_backend == 'true'
252-
name: 'Push backend Docker image to Docker Hub'
279+
name: "Push backend Docker image to Docker Hub"
253280
runs-on: blacksmith-16vcpu-ubuntu-2404
254281
steps:
255282
- uses: actions/checkout@v4
@@ -290,7 +317,6 @@ jobs:
290317
org.opencontainers.image.revision=${{ github.sha }}
291318
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
292319
293-
294320
# zombie_test_k8:
295321
# needs: [build_node, setup]
296322
# name: "Test Simple Network"
@@ -319,7 +345,7 @@ jobs:
319345

320346
network_test:
321347
needs: [build_node, setup]
322-
name: 'Network Test: Zombienet (Parachain + Relay)'
348+
name: "Network Test: Zombienet (Parachain + Relay)"
323349
runs-on: blacksmith-4vcpu-ubuntu-2404
324350
timeout-minutes: 30
325351
steps:
@@ -359,7 +385,7 @@ jobs:
359385
360386
zombie_test:
361387
needs: [build_node, setup]
362-
name: 'Network Test: Zombienet CLI'
388+
name: "Network Test: Zombienet CLI"
363389
timeout-minutes: 30
364390
runs-on: blacksmith-4vcpu-ubuntu-2404
365391
steps:
@@ -394,7 +420,7 @@ jobs:
394420
dev_node_test:
395421
needs: [build_node, setup]
396422
timeout-minutes: 30
397-
name: 'Node Tests: Solo Dev Node'
423+
name: "Node Tests: Solo Dev Node"
398424
runs-on: blacksmith-4vcpu-ubuntu-2404
399425
strategy:
400426
fail-fast: false
@@ -442,7 +468,7 @@ jobs:
442468
443469
full_net:
444470
needs: [build_node, setup]
445-
name: 'Integration Tests: FullNet'
471+
name: "Integration Tests: FullNet"
446472
runs-on: blacksmith-4vcpu-ubuntu-2404
447473
timeout-minutes: 30
448474
strategy:
@@ -533,7 +559,7 @@ jobs:
533559

534560
bsp_net:
535561
needs: [build_node, setup]
536-
name: 'Integration Tests: BSPNet'
562+
name: "Integration Tests: BSPNet"
537563
runs-on: blacksmith-4vcpu-ubuntu-2404
538564
timeout-minutes: 30
539565
strategy:
@@ -621,7 +647,7 @@ jobs:
621647

622648
backend_test:
623649
needs: [build_node, build_backend, setup]
624-
name: 'Integration Tests: Backend'
650+
name: "Integration Tests: Backend"
625651
runs-on: blacksmith-4vcpu-ubuntu-2404
626652
timeout-minutes: 30
627653
strategy:
@@ -679,7 +705,7 @@ jobs:
679705
run: |
680706
docker pull moonsonglabs/storage-hub:latest
681707
docker tag moonsonglabs/storage-hub:latest storage-hub:local
682-
708+
683709
- uses: taiki-e/install-action@v2
684710
with:
685711
tool: diesel_cli
@@ -740,7 +766,7 @@ jobs:
740766

741767
user_net:
742768
needs: [build_node, setup]
743-
name: 'Integration Tests: User'
769+
name: "Integration Tests: User"
744770
runs-on: blacksmith-4vcpu-ubuntu-2404
745771
timeout-minutes: 30
746772
strategy:
@@ -831,7 +857,7 @@ jobs:
831857

832858
fisherman_test:
833859
needs: [build_node, setup]
834-
name: 'Integration Tests: Fisherman'
860+
name: "Integration Tests: Fisherman"
835861
runs-on: blacksmith-4vcpu-ubuntu-2404
836862
timeout-minutes: 30
837863
steps:
@@ -917,7 +943,7 @@ jobs:
917943

918944
solochain_evm:
919945
needs: [build_node, build_backend, setup]
920-
name: 'Integration Tests: Solochain EVM'
946+
name: "Integration Tests: Solochain EVM"
921947
runs-on: blacksmith-4vcpu-ubuntu-2404
922948
timeout-minutes: 30
923949
steps:
@@ -1045,7 +1071,7 @@ jobs:
10451071

10461072
typegen_check:
10471073
needs: [build_node, setup]
1048-
name: 'Check Rust/TS bindings are up to date'
1074+
name: "Check Rust/TS bindings are up to date"
10491075
runs-on: blacksmith-4vcpu-ubuntu-2404
10501076
steps:
10511077
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)