Create universal binary for MacOS in workflow release (#551)

* Create universal binary for MacOS in workflow build
* Update README

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-22 16:52:36 +11:00 committed by GitHub
parent 62e350eba9
commit 707b173de1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -122,4 +122,28 @@ jobs:
retention-days: 1
name: "${{ matrix.target }}.${{ env.CBIN }}"
path: "${{ env.CBIN }}"
macos_universal_bin:
needs: build
runs-on: macos-latest
env:
aarch64: aarch64-apple-darwin.cargo-binstall
x86_64: x86_64-apple-darwin.cargo-binstall
steps:
- name: Download aarch64 artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.aarch64 }}
path: ${{ env.aarch64 }}
- name: Download x86-64 artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.x86_64 }}
path: ${{ env.x86_64 }}
- name: Create universal binary for MacOS
run: lipo -create -output cargo-binstall $aarch64/cargo-binstall $x86_64/cargo-binstall
- name: Upload output
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: universal-apple-darwin.cargo-binstall
path: cargo-binstall

View file

@ -25,6 +25,7 @@ We recommend using the pre-compiled ones because we optimize those more than a s
| linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz |
| macos | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip |
| macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip |
| macos | universal | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip |
| windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip |
To upgrade, use `cargo binstall cargo-binstall`!