-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build with 1.70.0 * compare polkadot-sdk now * srtool version * workaround for polkadot-sdk stuff * prepare optimized binary * prepare * now from dispatch * more work on prepare * prepare binary fixes * fix again * fix yet again * fixes and change to polkadot-sdk * ensure labels * unneeded extra space
- Loading branch information
Showing
4 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Enforce PR labels | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, unlabeled, opened, edited, synchronize] | ||
jobs: | ||
enforce-noteworthiness-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yogevbd/[email protected] | ||
with: | ||
REQUIRED_LABELS_ANY: "B0-silent,B5-clientnoteworthy,B7-runtimenoteworthy" | ||
REQUIRED_LABELS_ALL: "" | ||
BANNED_LABELS: "" | ||
- name: Verify breaking changes label | ||
if: contains(github.event.pull_request.labels.*.name, 'B5-clientnoteworthy') || contains(github.event.pull_request.labels.*.name, 'B7-runtimenoteworthy') | ||
uses: yogevbd/[email protected] | ||
with: | ||
REQUIRED_LABELS_ANY: "breaking,not-breaking" | ||
REQUIRED_LABELS_ALL: "" | ||
BANNED_LABELS: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Prepare Optimized Binary Draft (internal only) | ||
|
||
# The code (like generate-release-body) will be taken from the tag version, not master | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
sha: | ||
description: full sha to build the binary from | ||
required: true | ||
|
||
jobs: | ||
####### Building binaries ####### | ||
|
||
build-binary: | ||
runs-on: bare-metal | ||
strategy: | ||
matrix: | ||
cpu: ["", "skylake"] | ||
env: | ||
RUSTFLAGS: "-C target-cpu=${{ matrix.cpu }}" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.sha }} | ||
- name: Setup Rust toolchain | ||
run: rustup show | ||
- name: Build Node | ||
run: cargo build --profile=production --all | ||
- name: Save parachain binary | ||
if: ${{ matrix.cpu == '' }} | ||
run: | | ||
mkdir -p binaries | ||
cp target/production/tanssi-node binaries/tanssi-node | ||
cp target/production/container-chain-template-frontier-node binaries/container-chain-template-frontier-node | ||
cp target/production/container-chain-template-simple-node binaries/container-chain-template-simple-node | ||
- name: Save parachain custom binary | ||
if: ${{ matrix.cpu != '' }} | ||
run: | | ||
mkdir -p binaries | ||
cp target/production/tanssi-node binaries/tanssi-node-${{matrix.cpu}} | ||
cp target/production/container-chain-template-frontier-node binaries/container-chain-template-frontier-node-${{matrix.cpu}} | ||
cp target/production/container-chain-template-simple-node binaries/container-chain-template-simple-node-${{matrix.cpu}} | ||
- name: Upload binary | ||
uses: actions/[email protected] | ||
with: | ||
name: binaries | ||
path: binaries | ||
|
||
####### Prepare the release draft ####### | ||
docker-tanssi: | ||
runs-on: ubuntu-latest | ||
needs: ["build-binary"] | ||
strategy: | ||
matrix: | ||
image: ["tanssi", "container-chain-simple-template", "container-chain-evm-template"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.sha }} | ||
- uses: actions/[email protected] | ||
with: | ||
name: binaries | ||
path: build | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=moondancelabs/${{matrix.image}} | ||
SHA8="$(git log -1 --format="%H" | cut -c1-8)" | ||
TAGS="${DOCKER_IMAGE}:sha-${SHA8}-opt" | ||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT | ||
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
version: latest | ||
driver-opts: | | ||
image=moby/buildkit:master | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./docker/${{matrix.image}}.Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.tags }} | ||
labels: | | ||
org.opencontainers.image.title=${{ github.event.repository.name }} | ||
org.opencontainers.image.description=${{ github.event.repository.description }} | ||
org.opencontainers.image.url=${{ github.event.repository.html_url }} | ||
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Tag it with moondance-labs for 6 month | ||
run: | | ||
MOONDANCELABS_TAG=`echo "${{ steps.prep.outputs.tags }}"` | ||
docker pull ${{ steps.prep.outputs.tags }} | ||
docker tag ${{ steps.prep.outputs.tags }} $MOONDANCELABS_TAG | ||
docker push $MOONDANCELABS_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters