Skip to content

Commit

Permalink
Create universal binary for MacOS in workflow release (rust-lang#551)
Browse files Browse the repository at this point in the history
* Create universal binary for MacOS in workflow build
* Update README

Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu authored Nov 22, 2022
1 parent 62e350e commit 707b173
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`!
Expand Down

0 comments on commit 707b173

Please sign in to comment.