Skip to content

Commit

Permalink
Adding support for Universal Binary for MacOS on M1 (#450)
Browse files Browse the repository at this point in the history
* Adding universal binary support

* Bundle into universal

* Change name of macOS artifact

---------

Co-authored-by: Jackson Goode <jacksongoode@proton.me>
  • Loading branch information
dscso and jacksongoode committed Jan 23, 2024
1 parent c70ace5 commit 38422b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,29 @@ jobs:

- name: Build Release
run: cargo build --release


- name: Build aarch64 for MacOS
if: ${{ runner.os == 'macOS' }}
run: |
rustup target add aarch64-apple-darwin
cargo build --release --target aarch64-apple-darwin
- name: Bundle macOS Release
if: ${{ runner.os == 'macOS' }}
run: |
cargo install cargo-bundle
cargo bundle --release
working-directory: psst-gui

- name: Create macOS universal binary
if: ${{ runner.os == 'macOS' }}
run: lipo target/release/psst-gui target/aarch64-apple-darwin/release/psst-gui -create -output target/release/bundle/osx/Psst.app/Contents/MacOS/psst-gui

- name: Create macOS Disk Image
if: ${{ runner.os == 'macOS' }}
run: |
hdiutil create Psst-uncompressed.dmg -volname "Psst" -srcfolder target/release/bundle/osx
hdiutil convert Psst-uncompressed.dmg -format UDZO -o Psst-x64.dmg
hdiutil convert Psst-uncompressed.dmg -format UDZO -o Psst.dmg
- name: Make Linux Binary Executable
if: ${{ runner.os == 'Linux' }}
Expand All @@ -78,8 +88,8 @@ jobs:
uses: actions/upload-artifact@v3
if: ${{ runner.os == 'macOS' }}
with:
name: Psst-x64.dmg
path: ./Psst-x64.dmg
name: Psst.dmg
path: ./Psst.dmg

- name: Upload Windows Executable
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can download the prebuilt binaries for x86_64 Windows, Linux (Ubuntu), and m
| [Windows](https://nightly.link/jpochyla/psst/workflows/build/master/Psst.exe.zip) |
| [Linux (Ubuntu)](https://nightly.link/jpochyla/psst/workflows/build/master/psst-gui.zip) |
| [Debian Package](https://nightly.link/jpochyla/psst/workflows/build/master/psst-deb.zip) |
| [MacOS](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-x64.dmg.zip) |
| [MacOS](https://nightly.link/jpochyla/psst/workflows/build/master/Psst.dmg.zip) |

Unofficial builds of Psst are also available through the [AUR](https://aur.archlinux.org/packages/psst-git) and [Homebrew](https://formulae.brew.sh/cask/psst).

Expand Down

0 comments on commit 38422b1

Please sign in to comment.