diff --git a/.github/workflows/build-nethermind-packages.yml b/.github/workflows/build-nethermind-packages.yml index 5dd1d48ab42..2595c718407 100644 --- a/.github/workflows/build-nethermind-packages.yml +++ b/.github/workflows/build-nethermind-packages.yml @@ -1,65 +1,49 @@ name: Build Nethermind packages -on: +on: workflow_dispatch: jobs: build: name: Build Nethermind packages runs-on: ubuntu-latest - env: + env: PACKAGE_DIR: pkg PACKAGE_RETENTION: 7 PUB_DIR: pub steps: - - name: Check out Nethermind repository + - name: Check out repository uses: actions/checkout@v4 - with: - path: nethermind - - name: Check out Nethermind Launcher repository - uses: actions/checkout@v4 - with: - repository: NethermindEth/nethermind.launcher - path: launcher - name: Set up .NET uses: actions/setup-dotnet@v4 - with: - global-json-file: nethermind/global.json - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 14 - - name: Install npm packages - run: npm i -g pkg @vercel/ncc - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - name: Build Nethermind.Runner id: build-runner run: | - cd nethermind build_timestamp=$(date '+%s') echo "build-timestamp=$build_timestamp" >> $GITHUB_OUTPUT echo "commit-hash=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT scripts/deployment/build-runner.sh $GITHUB_SHA $build_timestamp - name: Build Nethermind.Cli - run: nethermind/scripts/deployment/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }} - - name: Build Nethermind launcher - run: nethermind/scripts/deployment/build-launcher.sh - - name: Build Nethermind launcher for Linux arm64 + run: scripts/deployment/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }} + - name: Bundle Nethermind launcher run: | - cd nethermind - docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load - docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/" - mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher + json=$(curl -s https://api.github.com/repos/nethermindeth/nethermind.launcher/releases/latest) + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux-x64"))') + curl -sSL $url -o $PUB_DIR/linux-x64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux-arm64"))') + curl -sSL $url -o $PUB_DIR/linux-arm64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("windows-x64"))') + curl -sSL $url -o $PUB_DIR/win-x64/nethermind-launcher.exe + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos-x64"))') + curl -sSL $url -o $PUB_DIR/osx-x64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos-arm64"))') + curl -sSL $url -o $PUB_DIR/osx-arm64/nethermind-launcher - name: Archive packages env: PACKAGE_PREFIX: nethermind-preview-${{ steps.build-runner.outputs.commit-hash }} run: | echo "PACKAGE_PREFIX=$PACKAGE_PREFIX" >> $GITHUB_ENV - nethermind/scripts/deployment/archive-packages.sh + scripts/deployment/archive-packages.sh - name: Upload Nethermind Linux x64 package uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01c810fa819..78f12ea5e0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: Release -on: +on: workflow_dispatch: inputs: tag: @@ -27,30 +27,10 @@ jobs: package-prefix: ${{ steps.archive.outputs.package-prefix }} prerelease: ${{ steps.build-runner.outputs.prerelease }} steps: - - name: Check out Nethermind repository - uses: actions/checkout@v4 - with: - path: nethermind - - name: Check out Nethermind Launcher repository + - name: Check out repository uses: actions/checkout@v4 - with: - repository: NethermindEth/nethermind.launcher - path: launcher - name: Set up .NET uses: actions/setup-dotnet@v4 - with: - global-json-file: nethermind/global.json - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 14 - - name: Install npm packages - run: npm i -g pkg @vercel/ncc - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - name: Build Nethermind.Runner id: build-runner run: | @@ -61,14 +41,19 @@ jobs: $SCRIPTS_PATH/build-runner.sh $GITHUB_SHA $build_timestamp - name: Build Nethermind.Cli run: $SCRIPTS_PATH/build-cli.sh $GITHUB_SHA ${{ steps.build-runner.outputs.build-timestamp }} - - name: Build Nethermind launcher - run: $SCRIPTS_PATH/build-launcher.sh - - name: Build Nethermind launcher for Linux arm64 - working-directory: nethermind + - name: Bundle Nethermind launcher run: | - docker buildx build --platform=linux/arm64 -t tmp-launcher -f Dockerfile.launcher . --load - docker run --platform=linux/arm64 -v $PWD:/opt/mount --rm tmp-launcher bash -c "cp /nethermind/nethermind-launcher /opt/mount/" - mv nethermind-launcher $GITHUB_WORKSPACE/$PUB_DIR/linux-arm64/nethermind-launcher + json=$(curl -s https://api.github.com/repos/nethermindeth/nethermind.launcher/releases/latest) + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux-x64"))') + curl -sSL $url -o $PUB_DIR/linux-x64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux-arm64"))') + curl -sSL $url -o $PUB_DIR/linux-arm64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("windows-x64"))') + curl -sSL $url -o $PUB_DIR/win-x64/nethermind-launcher.exe + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos-x64"))') + curl -sSL $url -o $PUB_DIR/osx-x64/nethermind-launcher + url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos-arm64"))') + curl -sSL $url -o $PUB_DIR/osx-arm64/nethermind-launcher - name: Archive packages id: archive env: @@ -112,7 +97,7 @@ jobs: name: ${{ steps.archive.outputs.package-prefix }}-ref-assemblies-package path: ${{ github.workspace }}/${{ env.PACKAGE_DIR }}/*ref-assemblies* retention-days: ${{ env.PACKAGE_RETENTION }} - + approval: name: Approve runs-on: ubuntu-latest diff --git a/Dockerfile.launcher b/Dockerfile.launcher deleted file mode 100644 index 28e45133000..00000000000 --- a/Dockerfile.launcher +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited -# SPDX-License-Identifier: LGPL-3.0-only - -FROM arm64v8/node AS build - -WORKDIR /source - -RUN npm i pkg @vercel/ncc -g && \ - git clone https://github.com/NethermindEth/nethermind.launcher.git && \ - cd nethermind.launcher && \ - npm install && \ - pkg index.js -t latest-linux-arm64 -o nethermind-launcher - - -FROM arm64v8/node AS launcher -WORKDIR /nethermind -COPY --from=build /source/nethermind.launcher/nethermind-launcher . diff --git a/scripts/deployment/build-cli.sh b/scripts/deployment/build-cli.sh index 42686b71dad..136c43b365f 100755 --- a/scripts/deployment/build-cli.sh +++ b/scripts/deployment/build-cli.sh @@ -6,7 +6,7 @@ set -e output_path=$GITHUB_WORKSPACE/$PUB_DIR -cd $GITHUB_WORKSPACE/nethermind/src/Nethermind/Nethermind.Cli +cd $GITHUB_WORKSPACE/src/Nethermind/Nethermind.Cli echo "Building Nethermind CLI" diff --git a/scripts/deployment/build-launcher.sh b/scripts/deployment/build-launcher.sh deleted file mode 100755 index 72b4342fa3b..00000000000 --- a/scripts/deployment/build-launcher.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited -# SPDX-License-Identifier: LGPL-3.0-only - -set -e - -app_name=nethermind-launcher -output_path=$GITHUB_WORKSPACE/$PUB_DIR - -echo "Building Nethermind Launcher" - -cd $GITHUB_WORKSPACE/launcher - -npm i -pkg index.js -t latest-linux-x64 -o $app_name && mv $app_name $output_path/linux-x64 -pkg index.js -t latest-win-x64 -o $app_name.exe && mv $app_name.exe $output_path/win-x64 -pkg index.js -t latest-macos-x64 -o $app_name && mv $app_name $output_path/osx-x64 && \ - cp $output_path/osx-x64/$app_name $output_path/osx-arm64/$app_name - -echo "Build completed" diff --git a/scripts/deployment/build-runner.sh b/scripts/deployment/build-runner.sh index 0cf0fe1b19a..558de445b7c 100755 --- a/scripts/deployment/build-runner.sh +++ b/scripts/deployment/build-runner.sh @@ -7,7 +7,7 @@ set -e build_config=release output_path=$GITHUB_WORKSPACE/$PUB_DIR -cd $GITHUB_WORKSPACE/nethermind/src/Nethermind/Nethermind.Runner +cd $GITHUB_WORKSPACE/src/Nethermind/Nethermind.Runner echo "Building Nethermind"