Skip to content

Commit 1f479c9

Browse files
committed
Don't build universal picotool/pioasm, and default to x64 on arm64 build
1 parent 7f0d634 commit 1f479c9

File tree

2 files changed

+17
-56
lines changed

2 files changed

+17
-56
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,44 +90,10 @@ jobs:
9090
bin/pico-sdk-tools-*-mac.zip
9191
bin/openocd-*-mac.zip
9292
bin/riscv-toolchain-*.zip
93-
94-
build_macos_x64:
95-
name: Build MacOS x64
96-
runs-on: 'macos-13'
97-
env:
98-
# Universal picotool is built on arm64
99-
SKIP_PICOTOOL: 1
10093
101-
steps:
102-
- name: Checkout
103-
uses: actions/checkout@v4
104-
- name: Set up Homebrew
105-
if: runner.environment == 'github-hosted'
106-
id: set-up-homebrew
107-
uses: Homebrew/actions/setup-homebrew@master
108-
- name: Build
109-
run: ./build_macos.sh
110-
- name: Upload Artifact
111-
uses: actions/upload-artifact@v4
112-
with:
113-
name: tools-mac-${{ runner.arch }}
114-
path: |
115-
bin/openocd-*-mac.zip
116-
bin/riscv-toolchain-*.zip
117-
- name: Add Release Asset
118-
uses: softprops/action-gh-release@v2
119-
if: startsWith(github.ref, 'refs/tags/')
120-
with:
121-
files: |
122-
bin/openocd-*-mac.zip
123-
bin/riscv-toolchain-*.zip
124-
125-
build_macos_x64_on_arm64:
94+
build_macos_x64:
12695
name: Build MacOS x64 on arm64
12796
runs-on: 'macos-14'
128-
env:
129-
# Universal picotool is built on arm64
130-
SKIP_PICOTOOL: 1
13197

13298
steps:
13399
- name: Checkout
@@ -150,15 +116,19 @@ jobs:
150116
- name: Upload Artifact
151117
uses: actions/upload-artifact@v4
152118
with:
153-
name: tools-mac-x64-on-arm64
119+
name: tools-mac-${{ runner.arch }}
154120
path: |
121+
bin/picotool-*-mac.zip
122+
bin/pico-sdk-tools-*-mac.zip
155123
bin/openocd-*-mac.zip
156124
bin/riscv-toolchain-*.zip
157125
- name: Add Release Asset
158126
uses: softprops/action-gh-release@v2
159127
if: startsWith(github.ref, 'refs/tags/')
160128
with:
161129
files: |
130+
bin/picotool-*-mac.zip
131+
bin/pico-sdk-tools-*-mac.zip
162132
bin/openocd-*-mac.zip
163133
bin/riscv-toolchain-*.zip
164134

build_macos.sh

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ SKIP_PICOTOOL=${SKIP_PICOTOOL-0}
1010
echo "Running on $(uname -m)"
1111

1212
# Install prerequisites
13-
arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi --quiet
1413
if [[ $(uname -m) == 'arm64' ]]; then
15-
arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi --quiet
14+
arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi --quiet
15+
else
16+
arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi --quiet
1617
fi
1718
# RISC-V prerequisites
1819
echo "Listing local"
@@ -21,9 +22,10 @@ rm /usr/local/bin/2to3* || true
2122
rm /usr/local/bin/idle3* || true
2223
rm /usr/local/bin/pip* || true
2324
rm /usr/local/bin/py* || true
24-
arch -x86_64 /usr/local/bin/brew install python3 gawk gnu-sed make gmp mpfr libmpc isl zlib expat texinfo flock libslirp --quiet
2525
if [[ $(uname -m) == 'arm64' ]]; then
26-
arch -arm64 /opt/homebrew/bin/brew install python3 gawk gnu-sed make gmp mpfr libmpc isl zlib expat texinfo flock libslirp --quiet
26+
arch -arm64 /opt/homebrew/bin/brew install python3 gawk gnu-sed make gmp mpfr libmpc isl zlib expat texinfo flock libslirp --quiet
27+
else
28+
arch -x86_64 /usr/local/bin/brew install python3 gawk gnu-sed make gmp mpfr libmpc isl zlib expat texinfo flock libslirp --quiet
2729
fi
2830

2931
repos=$(cat config/repositories.json | jq -c '.repositories.[]')
@@ -78,22 +80,11 @@ if [[ "$SKIP_RISCV" != 1 ]]; then
7880
echo "RISC-V dylibs copied"
7981
fi
8082
if [[ "$SKIP_PICOTOOL" != 1 ]]; then
81-
arch -x86_64 ../packages/macos/picotool/build-picotool.sh
82-
if [[ $(uname -m) == 'arm64' ]]; then
83-
arch -arm64 ../packages/macos/picotool/build-picotool.sh
84-
fi
83+
../packages/macos/picotool/build-picotool.sh
8584
echo "Picotool Build Complete"
8685

87-
../packages/macos/get-dylibs.sh "picotool-install-x86_64"
88-
if [[ $(uname -m) == 'arm64' ]]; then
89-
../packages/macos/get-dylibs.sh "picotool-install-arm64"
90-
fi
86+
../packages/macos/get-dylibs.sh "picotool-install-$(uname -m)"
9187
echo "Picotool dylibs copied"
92-
93-
../packages/macos/make-universal.sh "pico-sdk-tools" "pioasm" "pioasm"
94-
echo "Pioasm Universal Merge Complete"
95-
../packages/macos/make-universal.sh "picotool-install" "picotool" "picotool"
96-
echo "Picotool Universal Merge Complete"
9788
fi
9889
cd ..
9990

@@ -107,19 +98,19 @@ if [[ "$SKIP_PICOTOOL" != 1 ]]; then
10798
filename="pico-sdk-tools-${version}-${suffix}.zip"
10899

109100
echo "Saving pico-sdk-tools package to $filename"
110-
pushd "$builddir/pico-sdk-tools/"
101+
pushd "$builddir/pico-sdk-tools-$(uname -m)/"
111102
tar -a -cf "$topd/bin/$filename" * .keep
112103
popd
113104
fi
114105

115106
# Package picotool separately as well
116-
version=$("./$builddir/picotool-install/picotool/picotool" version -s)
107+
version=$("./$builddir/picotool-install-$(uname -m)/picotool/picotool" version -s)
117108
echo "Picotool version $version"
118109

119110
filename="picotool-${version}-${suffix}.zip"
120111

121112
echo "Saving picotool package to $filename"
122-
pushd "$builddir/picotool-install/"
113+
pushd "$builddir/picotool-install-$(uname -m)/"
123114
tar -a -cf "$topd/bin/$filename" * .keep
124115
popd
125116
fi

0 commit comments

Comments
 (0)