Skip to content

Commit

Permalink
Add CI builds for Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
Insprill committed Oct 3, 2023
1 parent 67ec1b4 commit bc17787
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -30,7 +29,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- target: 'x86_64-unknown-linux-gnu'
os: ubuntu-latest
- target: 'x86_64-pc-windows-msvc'
os: windows-latest
- target: 'x86_64-apple-darwin'
os: macos-latest
- target: 'aarch64-apple-darwin'
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand All @@ -43,12 +50,15 @@ jobs:
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libssl-dev libasound2-dev

- name: Install Target
run: rustup target add ${{ matrix.target }}

- name: Run Tests
run: cargo test
continue-on-error: true

- name: Build Release
run: cargo build --release
run: cargo build --release --target=${{ matrix.target }}

- name: Bundle macOS Release
if: ${{ runner.os == 'macOS' }}
Expand All @@ -60,33 +70,33 @@ jobs:
- 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 create Psst-uncompressed.dmg -volname "Psst" -srcfolder target/${{ matrix.target }}/release/bundle/osx
hdiutil convert Psst-uncompressed.dmg -format UDZO -o Psst-${{ matrix.target }}.dmg
- name: Make Linux Binary Executable
if: ${{ runner.os == 'Linux' }}
run: chmod +x target/release/psst-gui
run: chmod +x target/${{ matrix.target }}/release/psst-gui

- name: Upload Linux Binary
uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' }}
with:
name: psst-gui
path: target/release/psst-gui
name: Psst-${{ matrix.target }}
path: target/${{ matrix.target}}/release/psst-gui

- name: Upload macOS Disk Image
- name: Upload macOS Disk Image (x86_64)
uses: actions/upload-artifact@v3
if: ${{ runner.os == 'macOS' }}
with:
name: Psst-x64.dmg
path: ./Psst-x64.dmg
name: Psst-${{ matrix.target }}.dmg
path: ./Psst-${{ matrix.target }}.dmg

- name: Upload Windows Executable
uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Windows' }}
with:
name: Psst.exe
path: target/release/psst-gui.exe
name: Psst-${{ matrix.target }}.exe
path: target/${{ matrix.target }}/release/psst-gui.exe

deb:
runs-on: ubuntu-latest
Expand All @@ -98,7 +108,7 @@ jobs:
- name: Download Linux Binary
uses: actions/download-artifact@v3
with:
name: psst-gui
name: Psst-x86_64-unknown-linux-gnu
path: ${{runner.workspace}}

- name: Move Binary
Expand Down Expand Up @@ -135,7 +145,7 @@ jobs:
- name: Upload Debian Package
uses: actions/upload-artifact@v3
with:
name: psst-deb
name: Psst-deb
path: "*.deb"

appimage:
Expand All @@ -149,7 +159,7 @@ jobs:
- name: Download Debian Package
uses: actions/download-artifact@v3
with:
name: psst-deb
name: Psst-deb
path: ${{runner.workspace}}

- name: Install Dependencies
Expand Down Expand Up @@ -182,5 +192,5 @@ jobs:
- name: Upload AppImage
uses: actions/upload-artifact@v3
with:
name: psst-appimage
name: Psst-appimage
path: ${{runner.workspace}}/out/*.AppImage
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ You can download the prebuilt binaries for x86_64 Windows, Linux (Ubuntu), and m

| Platform |
|----------|
| [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) |
| [Windows](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-x86_64-pc-windows-msvc.zip) |
| [Linux (Ubuntu)](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-x86_64-unknown-linux-gnu.zip) |
| [Debian Package](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-deb.zip) |
| [MacOS (Intel)](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-x86_64-apple-darwin.dmg.zip) |
| [MacOS (Apple Silicon)](https://nightly.link/jpochyla/psst/workflows/build/master/Psst-x86_64-apple-darwin.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 bc17787

Please sign in to comment.