Skip to content

Commit e3039b4

Browse files
authored
Merge branch 'master' into evgeny-fix-srtools-permissions
2 parents 8ff7650 + eac3ec3 commit e3039b4

23 files changed

Lines changed: 293 additions & 298 deletions

.github/workflow-templates/cargo-build/action.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ runs:
7070
cp target/release/wbuild/flashbox-runtime/flashbox_runtime.compact.compressed.wasm runtimes/;
7171
cp target/release/wbuild/dancelight-runtime/dancelight_runtime.compact.compressed.wasm runtimes/;
7272
cp target/release/wbuild/starlight-runtime/starlight_runtime.compact.compressed.wasm runtimes/;
73-
- name: Save binaries
74-
shell: bash
75-
run: |
76-
mkdir -p binaries
77-
cp target/release/tanssi-node binaries/tanssi-node;
78-
cp target/release/container-chain-simple-node binaries/container-chain-simple-node;
79-
cp target/release/container-chain-frontier-node binaries/container-chain-frontier-node;
80-
cp target/release/tanssi-relay binaries/tanssi-relay;
81-
cp target/release/tanssi-relay-prepare-worker binaries/tanssi-relay-prepare-worker;
82-
cp target/release/tanssi-relay-execute-worker binaries/tanssi-relay-execute-worker;
73+
74+
- name: Copy parachain node binaries
75+
uses: ./.github/workflow-templates/copy-parachain-node-binaries
76+
with:
77+
cpu: ""
78+
profile: "release"
79+
80+
- name: Copy relaychain node binaries
81+
uses: ./.github/workflow-templates/copy-relaychain-node-binaries
82+
with:
83+
cpu: ""
84+
profile: "release"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Copy parachain node binaries
2+
3+
inputs:
4+
cpu:
5+
required: true
6+
type: string
7+
profile:
8+
required: false
9+
type: string
10+
default: "production"
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Copy parachain node binaries
16+
shell: bash
17+
run: |
18+
mkdir -p binaries
19+
suffix=""
20+
if [ "${{ inputs.cpu }}" != "" ]; then
21+
suffix="-${{ inputs.cpu }}"
22+
fi
23+
24+
cp target/${{ inputs.profile }}/tanssi-node binaries/tanssi-node$suffix
25+
cp target/${{ inputs.profile }}/container-chain-frontier-node binaries/container-chain-frontier-node$suffix
26+
cp target/${{ inputs.profile }}/container-chain-simple-node binaries/container-chain-simple-node$suffix
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Copy relaychain node binaries
2+
3+
inputs:
4+
cpu:
5+
required: true
6+
type: string
7+
profile:
8+
required: false
9+
type: string
10+
default: "production"
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Copy relaychain node binaries
16+
shell: bash
17+
run: |
18+
mkdir -p binaries
19+
suffix=""
20+
if [ "${{ inputs.cpu }}" != "" ]; then
21+
suffix="-${{ inputs.cpu }}"
22+
fi
23+
24+
cp target/${{ inputs.profile }}/tanssi-relay binaries/tanssi-relay$suffix
25+
cp target/${{ inputs.profile }}/tanssi-relay-execute-worker binaries/tanssi-relay-execute-worker$suffix
26+
cp target/${{ inputs.profile }}/tanssi-relay-prepare-worker binaries/tanssi-relay-prepare-worker$suffix
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Make binaries executable
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Make binaries executable
7+
shell: bash
8+
run: |
9+
chmod uog+x target/release/tanssi-node
10+
chmod uog+x target/release/tanssi-relay
11+
chmod uog+x target/release/tanssi-relay-prepare-worker
12+
chmod uog+x target/release/tanssi-relay-execute-worker
13+
chmod uog+x target/release/container-chain-simple-node
14+
chmod uog+x target/release/container-chain-frontier-node
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Node docker image
2+
3+
inputs:
4+
tag:
5+
required: true
6+
type: string
7+
image:
8+
required: true
9+
type: string
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Publish Node docker image
15+
shell: bash
16+
run: |
17+
DOCKER_IMAGE=moondancelabs/${{ inputs.image }}
18+
VERSION="${{ inputs.tag }}"
19+
CLEAN_VERSION="${VERSION%%-*}"
20+
COMMIT=`git rev-list -n 1 '${{ inputs.tag }}'`
21+
SHA=sha-${COMMIT::8}
22+
echo using "${DOCKER_IMAGE}:${SHA} as base image"
23+
24+
echo building "${DOCKER_IMAGE}:${CLEAN_VERSION}"
25+
docker build \
26+
--build-arg DOCKER_IMAGE="$DOCKER_IMAGE" \
27+
--build-arg SHA="$SHA" \
28+
-f docker/${{ inputs.image }}.Dockerfile \
29+
-t "${DOCKER_IMAGE}:${CLEAN_VERSION}" \
30+
.
31+
echo tagging "${DOCKER_IMAGE}:${CLEAN_VERSION}"
32+
docker push "${DOCKER_IMAGE}:${CLEAN_VERSION}"
33+
34+
if [[ $CLEAN_VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
35+
MINOR=${CLEAN_VERSION%.*}
36+
echo tagging "${DOCKER_IMAGE}:${MINOR}"
37+
docker tag "${DOCKER_IMAGE}:${CLEAN_VERSION}" "${DOCKER_IMAGE}:${MINOR}"
38+
docker push "${DOCKER_IMAGE}:${MINOR}"
39+
40+
MAJOR=${MINOR%.*}
41+
echo tagging "${DOCKER_IMAGE}:${MAJOR}"
42+
docker tag "${DOCKER_IMAGE}:${CLEAN_VERSION}" "${DOCKER_IMAGE}:${MAJOR}"
43+
docker push "${DOCKER_IMAGE}:${MAJOR}"
44+
45+
echo tagging "${DOCKER_IMAGE}:${SHA}"
46+
docker tag "${DOCKER_IMAGE}:${CLEAN_VERSION}" "${DOCKER_IMAGE}:${SHA}"
47+
docker push "${DOCKER_IMAGE}:${SHA}"
48+
49+
echo tagging "${DOCKER_IMAGE}:latest"
50+
docker tag "${DOCKER_IMAGE}:${CLEAN_VERSION}" "${DOCKER_IMAGE}:latest"
51+
docker push "${DOCKER_IMAGE}:latest"
52+
fi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish runtime docker image
2+
3+
inputs:
4+
tag:
5+
required: true
6+
type: string
7+
image:
8+
required: true
9+
type: string
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Publish runtime docker image
15+
shell: bash
16+
run: |
17+
DOCKER_IMAGE=moondancelabs/${{ inputs.image }}
18+
DOCKER_TAG="${{ inputs.tag }}"
19+
COMMIT=`git rev-list -n 1 '${{ inputs.tag }}'`
20+
SHA=sha-${COMMIT::8}
21+
echo tagging "${DOCKER_IMAGE}:${SHA}"
22+
docker pull "${DOCKER_IMAGE}:${SHA}"
23+
docker tag "${DOCKER_IMAGE}:${SHA}" "${DOCKER_IMAGE}:${DOCKER_TAG}"
24+
docker push "${DOCKER_IMAGE}:${DOCKER_TAG}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Generate Local interfaces for Typescript APi
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Generate Local interfaces for Typescript APi
7+
shell: bash
8+
run: |
9+
chmod uog+x target/release/tanssi-node
10+
chmod uog+x target/release/tanssi-relay
11+
cd typescript-api
12+
pnpm install --frozen-lockfile
13+
pnpm create-local-interfaces

.github/workflow-templates/typescript-tests-moonwall/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ runs:
3232
node-version: 22.x
3333
cache: "pnpm"
3434

35-
- name: Install typescript-api
36-
shell: bash
37-
run: |
38-
cd ./typescript-api
39-
pnpm install
40-
pnpm create-local-interfaces
35+
- name: Generate Typescript API Interfaces
36+
uses: ./.github/workflow-templates/typescript-create-api-interfaces
4137

4238
- name: Install and run
4339
shell: bash

.github/workflows/cmd.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,8 @@ jobs:
8686
node-version: 22.x
8787
cache: "pnpm"
8888

89-
# TODO: Extract to workflow template and re-use in other workflows (separate PR)
90-
- name: "Generate Local interfaces"
91-
run: |
92-
chmod uog+x target/release/tanssi-node
93-
chmod uog+x target/release/tanssi-relay
94-
cd typescript-api
95-
pnpm install --frozen-lockfile
96-
pnpm create-local-interfaces
89+
- name: Generate Typescript API Interfaces
90+
uses: ./.github/workflow-templates/typescript-create-api-interfaces
9791

9892
- name: Configure Git
9993
run: |

.github/workflows/docker-runtime-draft.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,17 @@ jobs:
6262
- name: Build Node parachains
6363
if: contains(needs.set-tags.outputs.git_branch, 'para')
6464
run: cargo build -p tanssi-node -p container-chain-frontier-node -p container-chain-simple-node --profile=production
65-
- name: Save binary
66-
if: ${{ matrix.cpu == '' }}
67-
run: |
68-
suffix = ""
69-
if [ "${{ matrix.cpu }}" != "" ]; then
70-
suffix="-${{ matrix.cpu }}"
71-
fi
72-
mkdir -p binaries
73-
if [[ "${{ needs.set-tags.outputs.git_branch }}" == *"para"* ]]; then
74-
cp target/production/tanssi-node binaries/tanssi-node$suffix
75-
cp target/production/container-chain-frontier-node binaries/container-chain-frontier-node$suffix
76-
cp target/production/container-chain-simple-node binaries/container-chain-simple-node$suffix
77-
else
78-
cp target/production/tanssi-relay binaries/tanssi-relay$suffix
79-
cp target/production/tanssi-relay-execute-worker binaries/tanssi-relay-execute-worker$suffix
80-
cp target/production/tanssi-relay-prepare-worker binaries/tanssi-relay-prepare-worker$suffix
81-
fi
65+
- name: Save binary (parachain)
66+
if: ${{ matrix.cpu == '' && contains(needs.set-tags.outputs.git_branch, 'para') }}
67+
uses: ./.github/actions/copy-parachain-node-binaries
68+
with:
69+
cpu: ${{ matrix.cpu }}
70+
71+
- name: Save binary (relaychain)
72+
if: ${{ matrix.cpu == '' && !contains(needs.set-tags.outputs.git_branch, 'para') }}
73+
uses: ./.github/actions/copy-relaychain-node-binaries
74+
with:
75+
cpu: ${{ matrix.cpu }}
8276
- name: Upload binaries
8377
uses: actions/upload-artifact@v4
8478
with:

0 commit comments

Comments
 (0)