github: automatically build and sign macOS dmg

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-11-27 14:52:32 -08:00
parent 921c0f1118
commit 79e0228790
2 changed files with 59 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable]
steps:
# Checkout the repository
@@ -96,6 +96,14 @@ jobs:
name: notedeck-linux-bin
path: target/release/notedeck
# Upload artifacts (for macOS, adjust paths as needed)
- name: Upload Build Artifacts (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: notedeck-macos-bin
path: target/release/notedeck
# Upload exe for further packaging steps
- name: Upload Build Artifacts (Windows)
if: runner.os == 'Windows'
@@ -150,6 +158,54 @@ jobs:
name: notedeck.deb
path: target/debian/*.deb
macos-dmg:
name: Build macOS DMG
runs-on: macos-latest
needs: build-and-test
env:
NOTEDECK_APPLE_RELEASE_CERT_ID: ${{ secrets.NOTEDECK_APPLE_RELEASE_CERT_ID }}
NOTEDECK_RELEASE_APPLE_ID: ${{ secrets.NOTEDECK_RELEASE_APPLE_ID }}
NOTEDECK_APPLE_APP_SPECIFIC_PW: ${{ secrets.NOTEDECK_APPLE_APP_SPECIFIC_PW }}
NOTEDECK_APPLE_TEAM_ID: ${{ secrets.NOTEDECK_APPLE_TEAM_ID }}
steps:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@v2
# Set up Rust
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Download Build Artifacts (MacOS)
uses: actions/download-artifact@v4
with:
name: notedeck-macos-bin # Assuming you need the Release build
path: target/release
- name: Install Required Tools
run: |
brew install create-dmg
cargo install cargo-bundle
- name: Import apple codesign cert
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Run macOS DMG Build Script
run: ./scripts/macos_build.sh
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
with:
name: notedeck.dmg
path: packages/notedeck.dmg
windows-installer:
name: Build Windows Installer
runs-on: windows-latest