Skip to content

Commit 7f56e95

Browse files
authored
ci(artifact): add target for macos on apple silicon (#2163)
This commit adds macOS target on Apple Silicon. Komodo wallet GUI has a new dependency that is incompatible with x86 architecture on macOS, breaking the current solution of building for x86 and running on Rosetta.
1 parent e8ab882 commit 7f56e95

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

.github/workflows/dev-build.yml

+61
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,67 @@ jobs:
156156
if: ${{ env.FILE_SERVER_KEY != '' }}
157157
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"
158158

159+
mac-arm64:
160+
timeout-minutes: 60
161+
runs-on: macos-latest
162+
steps:
163+
- uses: actions/checkout@v3
164+
- name: Install toolchain
165+
run: |
166+
rustup toolchain install nightly-2023-06-01 --no-self-update --profile=minimal
167+
rustup default nightly-2023-06-01
168+
rustup target add aarch64-apple-darwin
169+
170+
- name: Install build deps
171+
uses: ./.github/actions/deps-install
172+
with:
173+
deps: ('protoc', 'python3', 'paramiko')
174+
175+
- name: Calculate commit hash for PR commit
176+
if: github.event_name == 'pull_request'
177+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
178+
179+
- name: Calculate commit hash for merge commit
180+
if: github.event_name != 'pull_request'
181+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
182+
183+
- name: Cargo cache
184+
uses: ./.github/actions/cargo-cache
185+
186+
- name: Build
187+
run: |
188+
rm -f ./MM_VERSION
189+
echo $COMMIT_HASH > ./MM_VERSION
190+
cargo build --release --target aarch64-apple-darwin
191+
192+
- name: Compress mm2 build output
193+
env:
194+
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
195+
if: ${{ env.AVAILABLE != '' }}
196+
run: |
197+
NAME="mm2_$COMMIT_HASH-mac-arm64.zip"
198+
zip $NAME target/aarch64-apple-darwin/release/mm2 -j
199+
mkdir $BRANCH_NAME
200+
mv $NAME ./$BRANCH_NAME/
201+
202+
- name: Compress kdf build output
203+
env:
204+
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
205+
if: ${{ env.AVAILABLE != '' }}
206+
run: |
207+
NAME="kdf_$COMMIT_HASH-mac-arm64.zip"
208+
zip $NAME target/aarch64-apple-darwin/release/kdf -j
209+
mv $NAME ./$BRANCH_NAME/
210+
211+
- name: Upload build artifact
212+
env:
213+
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
214+
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
215+
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
216+
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
217+
if: ${{ env.FILE_SERVER_KEY != '' }}
218+
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"
219+
159220
win-x86-64:
160221
timeout-minutes: 60
161222
runs-on: windows-latest

.github/workflows/release-build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,61 @@ jobs:
141141
if: ${{ env.FILE_SERVER_KEY != '' }}
142142
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"
143143

144+
mac-arm64:
145+
timeout-minutes: 60
146+
runs-on: macos-latest
147+
steps:
148+
- uses: actions/checkout@v3
149+
- name: Install toolchain
150+
run: |
151+
rustup toolchain install nightly-2023-06-01 --no-self-update --profile=minimal
152+
rustup default nightly-2023-06-01
153+
rustup target add aarch64-apple-darwin
154+
155+
- name: Install build deps
156+
uses: ./.github/actions/deps-install
157+
with:
158+
deps: ('protoc', 'python3', 'paramiko')
159+
160+
- name: Calculate commit hash for PR commit
161+
if: github.event_name == 'pull_request'
162+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
163+
164+
- name: Calculate commit hash for merge commit
165+
if: github.event_name != 'pull_request'
166+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
167+
168+
- name: Cargo cache
169+
uses: ./.github/actions/cargo-cache
170+
171+
- name: Build
172+
run: |
173+
rm -f ./MM_VERSION
174+
echo $COMMIT_HASH > ./MM_VERSION
175+
cargo build --release --target aarch64-apple-darwin
176+
177+
- name: Compress mm2 build output
178+
run: |
179+
NAME="mm2_$COMMIT_HASH-mac-arm64.zip"
180+
zip $NAME target/aarch64-apple-darwin/release/mm2 -j
181+
mkdir $BRANCH_NAME
182+
mv $NAME ./$BRANCH_NAME/
183+
184+
- name: Compress kdf build output
185+
run: |
186+
NAME="kdf_$COMMIT_HASH-mac-arm64.zip"
187+
zip $NAME target/aarch64-apple-darwin/release/kdf -j
188+
mv $NAME ./$BRANCH_NAME/
189+
190+
- name: Upload build artifact
191+
env:
192+
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
193+
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
194+
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
195+
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
196+
if: ${{ env.FILE_SERVER_KEY != '' }}
197+
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"
198+
144199
win-x86-64:
145200
timeout-minutes: 60
146201
runs-on: windows-latest

0 commit comments

Comments
 (0)