From 7316585912e4e16f332ed0a98155aca3e78c50ac Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:11:42 +0200 Subject: [PATCH 1/4] Add `macOS-arm64` runners in build and test steps of the CI Handle "error: externally-managed-environment" on macOS arm64 runners when running `pip3 install toml` by adding a new step "Set up Python" --- .../actions/build-upload-mithril-artifact/action.yml | 5 +++++ .github/workflows/ci.yml | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/build-upload-mithril-artifact/action.yml b/.github/workflows/actions/build-upload-mithril-artifact/action.yml index 8858e1de413..9f36cf0d1cc 100644 --- a/.github/workflows/actions/build-upload-mithril-artifact/action.yml +++ b/.github/workflows/actions/build-upload-mithril-artifact/action.yml @@ -18,6 +18,11 @@ runs: shell: bash run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Add commit short sha to Cargo.tomls version shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }} run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a2c60f757c..ced7c781e69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,13 +75,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-12, windows-latest ] + os: [ macos-12, macos-14, windows-latest ] include: # Only build client on windows & mac - os: macos-12 binaries-build-args: --bin mithril-client --features bundle_openssl libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable + - os: macos-14 + binaries-build-args: --bin mithril-client --features bundle_openssl + libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable - os: windows-latest # Use `--bins --package ` instead of `--bin `, otherwise the 'windows' compatibility # hack in mithril common cargo.toml doesn't apply (we have no idea why). @@ -163,7 +166,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, macos-12, windows-latest ] + os: [ ubuntu-22.04, macos-12, macos-14, windows-latest ] include: - os: ubuntu-22.04 @@ -171,6 +174,8 @@ jobs: # Only test client on windows & mac (since its the only binaries supported for those os for now) - os: macos-12 test-args: --package mithril-client --package mithril-client-cli --features full,unstable + - os: macos-14 + test-args: --package mithril-client --package mithril-client-cli --features full,unstable - os: windows-latest test-args: --package mithril-client --package mithril-client-cli --features full,unstable From d52e6bb83c859a7ecc238828eef536283e297374 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:52:38 +0200 Subject: [PATCH 2/4] Add `macOS-arm64` version of the pre-built binaries in the releases --- .../workflows/actions/prepare-distribution/action.yml | 9 +++++++++ .github/workflows/ci.yml | 6 ++++++ .github/workflows/pre-release.yml | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/.github/workflows/actions/prepare-distribution/action.yml b/.github/workflows/actions/prepare-distribution/action.yml index 31b025f1a79..3b72ecc999d 100644 --- a/.github/workflows/actions/prepare-distribution/action.yml +++ b/.github/workflows/actions/prepare-distribution/action.yml @@ -38,6 +38,15 @@ runs: --version "${{ inputs.version-name }}" \ --target "macos-x64" + - name: Package distribution (macOS-arm64) + shell: bash + run: | + python3 ./.github/workflows/scripts/package-distribution.py \ + --input package-macOS-arm64/ \ + --dest package/ \ + --version "${{ inputs.version-name }}" \ + --target "macos-arm64" + - name: Package distribution (Windows-X64) shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ced7c781e69..b4b50575d1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -525,6 +525,12 @@ jobs: name: mithril-distribution-macOS-X64 path: ./package-macOS-X64 + - name: Download built artifacts (macOS-arm64) + uses: actions/download-artifact@v4 + with: + name: mithril-distribution-macOS-arm64 + path: ./package-macOS-arm64 + - name: Download built artifacts (Windows-X64) uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 0b7fb335bdf..07ec0e5505b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -45,6 +45,15 @@ jobs: workflow: ci.yml workflow_conclusion: success + - name: Download built artifacts (macOS-arm64) + uses: dawidd6/action-download-artifact@v3 + with: + name: mithril-distribution-macOS-arm64 + path: ./package-macOS-arm64 + commit: ${{ github.sha }} + workflow: ci.yml + workflow_conclusion: success + - name: Download built artifacts (Windows-x64) uses: dawidd6/action-download-artifact@v3 with: From cf70bbdd6f34907665ae2f582f6d051955e8dae3 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:56:45 +0200 Subject: [PATCH 3/4] Add test of `macOS-arm64` binaries in the Mithril Client multi-platform test manual workflow --- .github/workflows/test-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 24213c2b028..417065bcde0 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -46,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, macos-12, windows-latest ] + os: [ ubuntu-22.04, macos-12, macos-14, windows-latest ] runs-on: ${{ matrix.os }} steps: - name: Checkout sources From 4b9473e298f8ccc913e5960fb182960532528f20 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:19:17 +0200 Subject: [PATCH 4/4] chore: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c873818b63b..7030ae1a34f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ As a minor extension, we have adopted a slightly different versioning convention - Implement a lock mechanism on `SignedEntityType` to prevent concurrent work on a same entity type. +- Extended CI build and test steps for MacOS `arm64` runners and include pre-built binaries for MacOS `arm64` in the releases. + - **UNSTABLE** Cardano transactions certification: - Optimize the performances of the computation of the proof with a Merkle map. - Handle rollback events from the Cardano chain by removing stale data.