From 57bc4b42cee7b7460172ee8f2aae55ae0000df91 Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 20 Dec 2022 10:01:51 +0900 Subject: [PATCH 1/4] cmake & make: tweaks to make it build on M1 Mac --- CMakeLists.txt | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74e9697b2ee..17dfe4a6b3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,7 +282,7 @@ endif() include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external) if(APPLE) - include_directories(SYSTEM /usr/include/malloc) + include_directories(SYSTEM /usr/include/malloc /opt/homebrew/include) if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) endif() diff --git a/Makefile b/Makefile index a1f6faa2777..a1f6168b0f3 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ release-all: release-static: mkdir -p $(builddir)/release - cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release $(topdir) && $(MAKE) + cd $(builddir)/release && cmake -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release $(topdir) && $(MAKE) coverage: mkdir -p $(builddir)/debug From 259aabc4849eddf4350f184aa723c87c874bda3f Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 20 Dec 2022 14:45:52 +0900 Subject: [PATCH 2/4] slow-hash: use NO_AES & FORCE_USE_HEAP when building on M1 Mac --- src/crypto/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index 8732d9847b1..eae05659f17 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -105,4 +105,10 @@ if (ANDROID OR IOS) endif() endif() +# M1 Mac seems to behave oddly +if (APPLE AND ARM) + add_definitions(-DNO_AES) + add_definitions(-DFORCE_USE_HEAP) +endif() + From e134eb929c41145136d5710692b043d20c11d3bc Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 13 Dec 2022 13:19:39 +0900 Subject: [PATCH 3/4] add codemagic.yml --- codemagic.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 codemagic.yaml diff --git a/codemagic.yaml b/codemagic.yaml new file mode 100644 index 00000000000..fd62283713f --- /dev/null +++ b/codemagic.yaml @@ -0,0 +1,26 @@ +workflows: + build: + name: Build workflow + scripts: + - name: install dependencies + script: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost openssl zmq libpgm miniupnpc ldns expat libunwind-headers protobuf + - name: fetch zmq.hpp + script: brew tap osrf/simulation && brew install cppzmq + - name: build + script: USE_SINGLE_BUILDDIR=1 make release-static -j3 + - name: archive + working_directory: build/release + script: | + export ARTIFACT_NAME="aeon-mac-armv8-$(git describe --tags)" + mkdir $ARTIFACT_NAME + cp bin/* $ARTIFACT_NAME + tar cvzf $ARTIFACT_NAME.tar.bz2 $ARTIFACT_NAME + - name: SHA256 checksum + working_directory: build/release + script: | + export ARTIFACT_NAME="aeon-mac-armv8-$(git describe --tags)" + openssl sha256 $ARTIFACT_NAME.tar.bz2 + - name: upload to transfer.sh + script: | + export ARTIFACT_NAME="aeon-mac-armv8-$(git describe --tags)" + curl --upload-file build/release/$ARTIFACT_NAME.tar.bz2 https://transfer.sh/$ARTIFACT_NAME.tar.bz2 From 4b0d9ef6eb56cdb186f6d601285d74f943e5179d Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 17 Jan 2023 17:06:35 +0900 Subject: [PATCH 4/4] codemagic.yaml: add GitHub release logic --- codemagic.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/codemagic.yaml b/codemagic.yaml index fd62283713f..849e4c11b4a 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -1,6 +1,16 @@ workflows: build: name: Build workflow + triggering: + events: + - tag + branch_patterns: + - pattern: '*' + include: true + source: true + environment: + groups: + - github scripts: - name: install dependencies script: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost openssl zmq libpgm miniupnpc ldns expat libunwind-headers protobuf @@ -24,3 +34,13 @@ workflows: script: | export ARTIFACT_NAME="aeon-mac-armv8-$(git describe --tags)" curl --upload-file build/release/$ARTIFACT_NAME.tar.bz2 https://transfer.sh/$ARTIFACT_NAME.tar.bz2 + - name: Publish to GitHub + script: | + #!/usr/bin/env zsh + # Publish only for tag builds + if [ -z ${CM_TAG} ]; then + echo "Not a tag build, will not publish GitHub release" + exit 0 + fi + export ARTIFACT_NAME="aeon-mac-armv8-$(git describe --tags)" + gh release upload "${CM_TAG}" build/release/$ARTIFACT_NAME.tar.bz2