Skip to content

Commit

Permalink
Publish polkadot-omni-node binary (#6057)
Browse files Browse the repository at this point in the history
Closes #5566

Publish the `polkadot-omni-node` binary

This is a best effort. I'm not very familiar with the release /
publishing process and also not sure how to test this.
@paritytech/release-engineering can you take a look on this PR please ?

---------

Co-authored-by: EgorPopelyaev <[email protected]>
  • Loading branch information
serban300 and EgorPopelyaev authored Oct 30, 2024
1 parent 7aa3143 commit 01936b3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
build-runtimes:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "asset-hub-rococo bridge-hub-rococo contracts-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
excluded_runtimes: "asset-hub-rococo bridge-hub-rococo contracts-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template polkadot-sdk-docs-first"
build_opts: "--features on-chain-release-build"

build-binaries:
runs-on: ubuntu-latest
strategy:
matrix:
# Tuples of [package, binary-name]
binary: [ [frame-omni-bencher, frame-omni-bencher], [staging-chain-spec-builder, chain-spec-builder] ]
binary: [ [frame-omni-bencher, frame-omni-bencher], [staging-chain-spec-builder, chain-spec-builder], [polkadot-omni-node, polkadot-omni-node] ]
steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.0.0
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
binary: [frame-omni-bencher, chain-spec-builder]
binary: [frame-omni-bencher, chain-spec-builder, polkadot-omni-node]

steps:
- name: Download artifacts
Expand Down
41 changes: 21 additions & 20 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
type: choice
options:
- polkadot
- polkadot-omni-node
- polkadot-parachain
- chain-spec-builder

Expand Down Expand Up @@ -80,9 +81,9 @@ jobs:
validate-inputs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.validate_inputs.outputs.VERSION }}
release_id: ${{ steps.validate_inputs.outputs.RELEASE_ID }}
stable_tag: ${{ steps.validate_inputs.outputs.stable_tag }}
version: ${{ steps.validate_inputs.outputs.VERSION }}
release_id: ${{ steps.validate_inputs.outputs.RELEASE_ID }}
stable_tag: ${{ steps.validate_inputs.outputs.stable_tag }}

steps:
- name: Checkout sources
Expand All @@ -105,15 +106,15 @@ jobs:
echo "stable_tag=${STABLE_TAG}" >> $GITHUB_OUTPUT
fetch-artifacts: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
needs: [validate-inputs]
needs: [ validate-inputs ]

steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

#TODO: this step will be needed when automated triggering will work
#TODO: this step will be needed when automated triggering will work
#this step runs only if the workflow is triggered automatically when new release is published
# if: ${{ env.EVENT_NAME == 'release' && env.EVENT_ACTION != '' && env.EVENT_ACTION == 'published' }}
# run: |
Expand All @@ -129,7 +130,7 @@ jobs:

- name: Fetch rc artifacts or release artifacts from s3 based on version
#this step runs only if the workflow is triggered manually
if: ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary != 'chain-spec-builder'}}
if: ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary != 'polkadot-omni-node' && inputs.binary != 'chain-spec-builder'}}
run: |
. ./.github/scripts/common/lib.sh
Expand All @@ -143,9 +144,9 @@ jobs:
fetch_release_artifacts_from_s3 $BINARY
fi
- name: Fetch chain-spec-builder rc artifacts or release artifacts based on release id
- name: Fetch polkadot-omni-node/chain-spec-builder rc artifacts or release artifacts based on release id
#this step runs only if the workflow is triggered manually and only for chain-spec-builder
if: ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary == 'chain-spec-builder' }}
if: ${{ env.EVENT_NAME == 'workflow_dispatch' && (inputs.binary == 'polkadot-omni-node' || inputs.binary == 'chain-spec-builder') }}
run: |
. ./.github/scripts/common/lib.sh
Expand All @@ -159,9 +160,9 @@ jobs:
path: release-artifacts/${{ env.BINARY }}/**/*

build-container: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
needs: [fetch-artifacts, validate-inputs]
needs: [ fetch-artifacts, validate-inputs ]
environment: release

steps:
Expand Down Expand Up @@ -231,8 +232,8 @@ jobs:
echo "Building container for $BINARY"
./docker/scripts/polkadot/build-injected.sh $ARTIFACTS_FOLDER
- name: Build Injected Container image chain-spec-builder
if: ${{ env.BINARY == 'chain-spec-builder' }}
- name: Build Injected Container image for polkadot-omni-node/chain-spec-builder
if: ${{ env.BINARY == 'polkadot-omni-node' || env.BINARY == 'chain-spec-builder' }}
env:
ARTIFACTS_FOLDER: release-artifacts
IMAGE_NAME: ${{ env.BINARY }}
Expand Down Expand Up @@ -266,8 +267,8 @@ jobs:
username: ${{ secrets.POLKADOT_DOCKERHUB_USERNAME }}
password: ${{ secrets.POLKADOT_DOCKERHUB_TOKEN }}

- name: Login to Dockerhub to puiblish polkadot-parachain/chain-spec-builder
if: ${{ env.BINARY == 'polkadot-parachain' || env.BINARY == 'chain-spec-builder' }}
- name: Login to Dockerhub to publish polkadot-omni-node/polkadot-parachain/chain-spec-builder
if: ${{ env.BINARY == 'polkadot-omni-node' || env.BINARY == 'polkadot-parachain' || env.BINARY == 'chain-spec-builder' }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.CUMULUS_DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -315,7 +316,7 @@ jobs:
build-polkadot-release-container: # this job will be triggered for polkadot release build
if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
runs-on: ubuntu-latest
needs: [fetch-latest-debian-package-version, validate-inputs]
needs: [ fetch-latest-debian-package-version, validate-inputs ]
environment: release
steps:
- name: Checkout sources
Expand All @@ -327,10 +328,10 @@ jobs:
- name: Cache Docker layers
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
Expand Down
14 changes: 14 additions & 0 deletions docker/scripts/polkadot-omni-node/build-injected.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile

PROJECT_ROOT=`git rev-parse --show-toplevel`

export BINARY=polkadot-omni-node
export ARTIFACTS_FOLDER=$1
# export TAGS=...

$PROJECT_ROOT/docker/scripts/build-injected.sh

0 comments on commit 01936b3

Please sign in to comment.