Skip to content

Commit

Permalink
Fix client binary build after artifact-upload changes (moonbeam-found…
Browse files Browse the repository at this point in the history
…ation#2755)

* disable docker cache

* add binary overwrite

* migrate upload/download actions

* fix cpu target name

* fix download action parameters

* lock deps for subxt-cli

* use runtime spec instead of commit

---------

Co-authored-by: noandrea <[email protected]>
  • Loading branch information
RomarQ and noandrea authored Apr 15, 2024
1 parent d50b6f5 commit fadc387
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/publish-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: bare-metal
strategy:
matrix:
cpu: ["", "skylake", "znver3"]
cpu: ["x86-64", "skylake", "znver3"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -39,7 +39,7 @@ jobs:
# Build moonbeam
# (we don't use volumes because of ownership/permissions issues)
docker build \
--tag prod \
--tag prod --no-cache \
--build-arg="COMMIT=${{ github.event.inputs.to }}" \
--build-arg="RUSTFLAGS=-C target-cpu=${{ matrix.cpu }}" \
- < docker/moonbeam-production.Dockerfile
Expand All @@ -54,20 +54,14 @@ jobs:
docker rmi prod
- name: Save parachain binary
if: ${{ matrix.cpu == '' }}
run: |
mkdir -p build
cp moonbeam build/moonbeam
- name: Save parachain custom binary
if: ${{ matrix.cpu != '' }}
run: |
mkdir -p build
cp moonbeam build/moonbeam-${{matrix.cpu}}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: binaries
path: build
name: binaries-${{matrix.cpu}}
path: build/moonbeam-${{matrix.cpu}}

####### Prepare the release draft #######

Expand All @@ -85,7 +79,8 @@ jobs:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
path: build
- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -102,6 +97,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: original-tools
run: |
mv ../build/moonbeam-x86-64 ../build/moonbeam
yarn
yarn -s run ts-node github/generate-release-body.ts --owner "${{ github.repository_owner }}" --repo "$(basename ${{ github.repository }})" --from "${{ github.event.inputs.from }}" --to "${{ github.event.inputs.to }}" --srtool-report-folder '../build/' > ../body.md
- name: Create draft release
Expand All @@ -122,26 +118,27 @@ jobs:
needs: ["build-binary", "publish-draft-release"]
strategy:
matrix:
cpu: ["", "skylake", "znver3"]
cpu: ["x86-64", "skylake", "znver3"]
node: ["moonbeam"]
steps:
- uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
path: build
- name: Upload moonbeam
uses: actions/upload-release-asset@v1
if: ${{ matrix.cpu == '' }}
if: ${{ matrix.cpu == 'x86-64' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish-draft-release.outputs.asset_upload_url }}
asset_path: build/${{matrix.node}}
asset_path: build/${{matrix.node}}-${{matrix.cpu}}
asset_name: ${{matrix.node}}
asset_content_type: application/octet-stream
- name: Upload moonbeam custom binary
uses: actions/upload-release-asset@v1
if: ${{ matrix.cpu != '' }}
if: ${{ matrix.cpu != 'x86-64' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -162,14 +159,17 @@ jobs:
ref: ${{ github.event.inputs.to }}
- uses: actions/download-artifact@v4
with:
name: binaries
pattern: binaries-*
merge-multiple: true
path: build
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.MBF_DOCKERHUB_USERNAME }}
password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }}
- run: |
mv build/moonbeam-x86-64 build/moonbeam
DOCKER_IMAGE=moonbeamfoundation/moonbeam
COMMIT=`git rev-list -n 1 '${{ github.event.inputs.to }}'`
SHA=sha-${COMMIT::8}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/subxt-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Subxt Diff
on:
workflow_dispatch:
inputs:
last_release_sha8:
description: The sha8 of the last release, with which to compare local to.
last_spec_version:
description: The runtime spec of the last release, with which to compare local to (ex. 1500)
required: true
spec_version:
description: runtime spec version (ex. 1601)
Expand Down Expand Up @@ -40,12 +40,12 @@ jobs:
path: build
- name: Install Subxt-cli
run: |
cargo install subxt-cli
cargo install subxt-cli --locked
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run last_release node via Docker
run: |
docker pull moonbeamfoundation/moonbeam:sha-${{ github.event.inputs.last_release_sha8 }}
docker run -d --name moonbeam_container -p 9911:9911 moonbeamfoundation/moonbeam:sha-${{ github.event.inputs.last_release_sha8 }} \
docker pull moonbeamfoundation/moonbeam:runtime-${{ github.event.inputs.last_spec_version }}
docker run -d --name moonbeam_container -p 9911:9911 moonbeamfoundation/moonbeam:runtime-${{ github.event.inputs.last_spec_version }} \
--chain=${{ matrix.runtime }}-dev \
--no-hardware-benchmarks \
--no-telemetry \
Expand Down

0 comments on commit fadc387

Please sign in to comment.