1
0
Fork 0
forked from lthn/blockchain
blockchain/.github/workflows/build-macos-arm64.yml
2025-08-30 17:46:00 +01:00

139 lines
4.4 KiB
YAML

name: build-macos-arm64
permissions:
contents: write
on:
workflow_call:
inputs:
chain-network:
description: "The network to use, can either be testnet, stagenet or mainnet"
default: testnet
required: false
type: string
build-cli:
description: "Should the CLI be built"
default: true
required: false
type: boolean
build-gui:
description: "Should the GUI be built"
default: true
required: false
type: boolean
release:
description: "Make a release"
default: true
required: false
type: boolean
release-tag:
required: false
type: string
description: 'The tag for the release'
jobs:
build-cli:
name: MacOS Arm64
runs-on: macos-15
steps:
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: install dependencies
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache miniupnpc
- run: mkdir -p build/openssl
- run: mkdir -p build/ccache
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/build/openssl
key: openssl-${{ runner.os }}-${{ runner.arch }}
- name: ccache caching
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/build/ccache
key: ccache-${{ inputs.chain-network }}-cli-${{ runner.os }}-${{ runner.arch }}
- name: Install boost
uses: MarkusJx/install-boost@6d8df42f57de83c5b326b5b83e7b35d650030103
id: install-boost
with:
boost_version: 1.84.0
boost_install_dir: ${{ github.workspace }}/build/boost_1_84_0
platform_version: 14
toolset: clang
arch: aarch64
- name: Build OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: |
cd build
curl -OL https://www.openssl.org/source/openssl-1.1.1w.tar.gz
echo "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 openssl-1.1.1w.tar.gz" | shasum -c && tar -xjf openssl-1.1.1w.tar.gz
rm openssl-1.1.1w.tar.gz && cd openssl-1.1.1w
export MACOSX_DEPLOYMENT_TARGET=12.0
./config --prefix=${{ github.workspace }}/build/openssl --openssldir=${{ github.workspace }}/build/openssl shared zlib
make -j3 && make install_sw install_ssldirs && cd ..
rm -rf openssl-1.1.1w/
- name: Install Qt
if: ${{ inputs.build-gui }}
uses: jurplel/install-qt-action@v3
with:
dir: '${{ github.workspace }}/build/qt/'
aqtversion: '==3.1.*'
version: '6.8.3'
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qt5compat qtwebengine qtwebchannel qtpositioning'
- name: Build CLI
uses: ./.github/actions/cmake-build
with:
jobs: '3'
build-type: 'Release'
chain-network: ${{ inputs.chain-network }}
boost-root: ${{ steps.install-boost.outputs.BOOST_ROOT }}
target: 'daemon simplewallet'
- name: CLI Artifacts
if: ${{ inputs.build-cli }}
uses: ./.github/actions/sign-and-upload-release
with:
chain-network: ${{ inputs.chain-network }}
release-tag: ${{ github.ref_name }}
release: "${{ inputs.release }}"
assets: |
zanod
simplewallet
asset-type: 'cli'
asset-directory: ${{ github.workspace }}/build/release/src
- name: Build GUI
if: ${{ inputs.build-gui }}
uses: ./.github/actions/cmake-build
with:
jobs: '3'
build-type: 'Release'
chain-network: ${{ inputs.chain-network }}
boost-root: ${{ steps.install-boost.outputs.BOOST_ROOT }}
target: 'Zano'
build-gui: 'true'
- name: GUI Artifacts
if: ${{ inputs.build-gui }}
uses: ./.github/actions/sign-and-upload-release
with:
chain-network: ${{ inputs.chain-network }}
release-tag: ${{ github.ref_name }}
release: "${{ inputs.release }}"
assets: |
Zano.app
asset-type: 'gui'
asset-directory: ${{ github.workspace }}/build/release/src