From 76d33a74b1bfc01d1430d563fdac891b93275031 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 28 Sep 2025 18:34:57 +0100 Subject: [PATCH] Add ARM64 build workflows and refactor CI for multi-arch Introduced separate build workflows for Linux and Windows ARM64 architectures. Renamed existing Intel build workflows for clarity and updated the main workflow to trigger both Intel and ARM64 builds for Linux and Windows. Improved caching by including architecture in cache keys and set CPU_CORES for release builds across all platforms. --- .github/workflows/_on-push.yml | 20 ++++++-- .github/workflows/build-linux-arm64.yml | 48 +++++++++++++++++++ ...{build-linux.yml => build-linux-intel.yml} | 4 +- .github/workflows/build-macos-arm64.yml | 4 +- .github/workflows/build-macos-intel.yml | 4 +- .github/workflows/build-windows-arm64.yml | 45 +++++++++++++++++ ...ld-windows.yml => build-windows-intel.yml} | 4 +- 7 files changed, 117 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-linux-arm64.yml rename .github/workflows/{build-linux.yml => build-linux-intel.yml} (88%) create mode 100644 .github/workflows/build-windows-arm64.yml rename .github/workflows/{build-windows.yml => build-windows-intel.yml} (87%) diff --git a/.github/workflows/_on-push.yml b/.github/workflows/_on-push.yml index 036ea78e..6af0f647 100644 --- a/.github/workflows/_on-push.yml +++ b/.github/workflows/_on-push.yml @@ -16,15 +16,27 @@ concurrency: cancel-in-progress: true jobs: - build-linux: + build-linux-intel: name: Chain - uses: ./.github/workflows/build-linux.yml + uses: ./.github/workflows/build-linux-intel.yml with: chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} - build-windows: + build-linux-arm: name: Chain - uses: ./.github/workflows/build-windows.yml + uses: ./.github/workflows/build-linux-arm64.yml + with: + chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} + + build-windows-intel: + name: Chain + uses: ./.github/workflows/build-windows-intel.yml + with: + chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} + + build-windows-arm: + name: Chain + uses: ./.github/workflows/build-windows-arm64.yml with: chain-network: ${{ github.ref_name == 'main' && 'mainnet' || 'testnet' }} diff --git a/.github/workflows/build-linux-arm64.yml b/.github/workflows/build-linux-arm64.yml new file mode 100644 index 00000000..8e27fa66 --- /dev/null +++ b/.github/workflows/build-linux-arm64.yml @@ -0,0 +1,48 @@ +name: Linux +permissions: + contents: read +on: + workflow_call: + inputs: + chain-network: + description: "The network to use, can either be testnet, stagenet or mainnet" + default: testnet + required: false + type: string + +jobs: + build: + name: gcc-linux-arm64 + runs-on: ubuntu-22.04-arm + steps: + - name: Checkout Project + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - name: install dependencies + run: sudo apt-get install -y autotools-dev git build-essential + + - name: Cache SDK Folder + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/build/sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Install Conan + uses: conan-io/setup-conan@v1 + with: + home: ${{ github.workspace }}/build/sdk + cache_packages: false + + - name: Compile Release + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + + - name: CLI Artifacts + uses: ./.github/actions/upload-artifacts + with: + chain-network: ${{ inputs.chain-network }} + assets: lethean-* + asset-type: 'cli' + asset-directory: ${{ github.workspace }}/build/release/packages diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux-intel.yml similarity index 88% rename from .github/workflows/build-linux.yml rename to .github/workflows/build-linux-intel.yml index 89094a1b..63390528 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux-intel.yml @@ -28,7 +28,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ github.workspace }}/build/sdk - key: ${{ runner.os }}-sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk - name: Install Conan uses: conan-io/setup-conan@v1 @@ -37,7 +37,7 @@ jobs: cache_packages: false - name: Compile Release - run: make release TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-macos-arm64.yml b/.github/workflows/build-macos-arm64.yml index c549e0f7..de10e2fb 100644 --- a/.github/workflows/build-macos-arm64.yml +++ b/.github/workflows/build-macos-arm64.yml @@ -27,7 +27,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ github.workspace }}/build/sdk - key: ${{ runner.os }}-sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk - name: Install Conan uses: conan-io/setup-conan@v1 @@ -39,7 +39,7 @@ jobs: # run: make apple-clang-armv8 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - name: Compile Release - run: make release TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - name: CLI Artifacts diff --git a/.github/workflows/build-macos-intel.yml b/.github/workflows/build-macos-intel.yml index c664a3ce..72913593 100644 --- a/.github/workflows/build-macos-intel.yml +++ b/.github/workflows/build-macos-intel.yml @@ -26,7 +26,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ github.workspace }}/build/sdk - key: ${{ runner.os }}-sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk - name: Install Conan uses: conan-io/setup-conan@v1 @@ -35,7 +35,7 @@ jobs: cache_packages: false - name: Compile Release - run: make release TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-windows-arm64.yml b/.github/workflows/build-windows-arm64.yml new file mode 100644 index 00000000..c48559f4 --- /dev/null +++ b/.github/workflows/build-windows-arm64.yml @@ -0,0 +1,45 @@ +name: build-windows +permissions: + contents: read +on: + workflow_call: + inputs: + chain-network: + description: "The network to use, can either be testnet, stagenet or mainnet" + default: testnet + required: false + type: string + +jobs: + msvc-194: + name: msvc-194-arm64 + runs-on: windows-11-arm + steps: + - name: Checkout Project + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + submodules: recursive + + - name: Cache SDK Folder + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/build/sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk + + - name: Install Conan + uses: conan-io/setup-conan@v1 + with: + home: ${{ github.workspace }}/build/sdk + cache_packages: false + + - name: Compile Release + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + + - name: CLI Artifacts + uses: ./.github/actions/upload-artifacts + with: + chain-network: ${{ inputs.chain-network }} + assets: lethean-* + asset-type: 'cli' + asset-directory: ${{ github.workspace }}/build/release/packages diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows-intel.yml similarity index 87% rename from .github/workflows/build-windows.yml rename to .github/workflows/build-windows-intel.yml index ba6db426..66c9ab1e 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows-intel.yml @@ -25,7 +25,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ github.workspace }}/build/sdk - key: ${{ runner.os }}-sdk + key: ${{ runner.os }}-${{ runner.arch }}-sdk - name: Install Conan uses: conan-io/setup-conan@v1 @@ -34,7 +34,7 @@ jobs: cache_packages: false - name: Compile Release - run: make release TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts