Skip to content

Commit

Permalink
Add support for building universal macOS binaries
Browse files Browse the repository at this point in the history
This resolves robbert-vdh#17.
  • Loading branch information
robbert-vdh committed Sep 15, 2022
1 parent 5dc9349 commit 6b0eecb
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 78 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
matrix:
include:
- { name: ubuntu-18.04, os: ubuntu-18.04, cross-target: '' }
- { name: macos-10.15-x86_64, os: macos-10.15, cross-target: '' }
- { name: macos-11-aarch64, os: macos-11, cross-target: aarch64-apple-darwin }
- { name: macos-universal, os: macos-11, cross-target: aarch64-apple-darwin }
- { name: windows, os: windows-latest, cross-target: '' }
name: Package plugin binaries
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -61,8 +60,8 @@ jobs:
toolchain: nightly-2022-07-15
profile: minimal
default: true
# The macOS AArch64 build is done from an x86_64 macOS CI runner, so
# it needs to be cross compiled
# The macOS AArch64/universal build is done from an x86_64 macOS CI
# runner, so it needs to be cross compiled
target: ${{ matrix.cross-target }}
- name: Package all targets from bundler.toml
# Instead of hardcoding which targets to build and package, we'll
Expand All @@ -74,12 +73,17 @@ jobs:
package_args+=("-p" "$package")
done
cross_target=${{ matrix.cross-target }}
if [[ -n $cross_target ]]; then
package_args+=("--target" "$cross_target")
fi
runner_name=${{ matrix.name }}
if [[ $runner_name = 'macos-universal' ]]; then
cargo xtask bundle-universal "${package_args[@]}" --release
else
cross_target=${{ matrix.cross-target }}
if [[ -n $cross_target ]]; then
package_args+=("--target" "$cross_target")
fi
cargo xtask bundle "${package_args[@]}" --release
cargo xtask bundle "${package_args[@]}" --release
fi
- name: Determine build archive name
run: |
Expand Down
Loading

0 comments on commit 6b0eecb

Please sign in to comment.