Skip to content

update build process for newer macOS+ #4

update build process for newer macOS+

update build process for newer macOS+ #4

Workflow file for this run

name: Build Package
on:
push:
branches: [ main, beta ]
pull_request:
branches: [ main, beta ]
workflow_dispatch:
jobs:
build-standalone:
name: Build Standalone App (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build standalone Homebridge.app
run: bash build-standalone-app.sh
- name: Build standalone DMG
run: bash scripts/make-standalone-dmg.sh
env:
VOL_NAME: Homebridge
VERSION: ${{ github.ref_name }}
- name: List outputs
run: ls -lh build/
- name: Upload standalone DMG artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: homebridge-standalone-dmg
path: build/homebridge-standalone-*.dmg
retention-days: 90
if-no-files-found: error
build-legacy:
name: Build Legacy PKG (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build staging
run: bash build.sh --staging-only
- name: Build legacy PKG with native tools
run: bash scripts/make-pkg-native.sh
env:
VERSION: ${{ github.ref_name }}
- name: Build legacy DMG
run: bash scripts/make-dmg.sh
env:
VOL_NAME: Homebridge
- name: List outputs
run: ls -lh build/
- name: Upload legacy PKG artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: homebridge-legacy-pkg
path: build/*.pkg
retention-days: 30
if-no-files-found: warn
- name: Upload legacy DMG artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: homebridge-legacy-dmg
path: build/homebridge.dmg
retention-days: 30
if-no-files-found: warn
staging:
name: Build Staging (Linux Container)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build staging tarball in container
run: bash scripts/container-build.sh
- name: Upload staging artifact
uses: actions/upload-artifact@v4
with:
name: homebridge-staging
path: build/homebridge-staging.tar.gz
retention-days: 30
# Optional: signing and notarization job (requires secrets)
# Uncomment and configure secrets to enable
# sign-and-notarize:
# name: Sign and Notarize Standalone
# runs-on: macos-latest
# needs: build-standalone
# if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: homebridge-standalone-dmg
# path: build/
#
# - name: Import signing certificate
# env:
# CERTIFICATE_P12: ${{ secrets.APPLE_CERTIFICATE_P12 }}
# CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# run: |
# echo "$CERTIFICATE_P12" | base64 --decode > cert.p12
# security create-keychain -p actions temp.keychain
# security default-keychain -s temp.keychain
# security unlock-keychain -p actions temp.keychain
# security import cert.p12 -k temp.keychain -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productsign
# security set-key-partition-list -S apple-tool:,apple: -s -k actions temp.keychain
# rm cert.p12
#
# - name: Codesign and notarize
# env:
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# SIGN_ID: ${{ secrets.APPLE_SIGN_ID }}
# run: |
# # Sign the app inside the DMG
# hdiutil attach build/homebridge-standalone-*.dmg -mountpoint /tmp/dmg
# codesign --force --deep --options runtime --timestamp --sign "$SIGN_ID" /tmp/dmg/Homebridge.app
# hdiutil detach /tmp/dmg
#
# # Sign the DMG
# codesign --force --sign "$SIGN_ID" build/homebridge-standalone-*.dmg
#
# # Submit for notarization
# xcrun notarytool submit build/homebridge-standalone-*.dmg \
# --apple-id "$APPLE_ID" \
# --password "$APPLE_PASSWORD" \
# --team-id "$APPLE_TEAM_ID" \
# --wait
#
# # Staple the notarization ticket
# xcrun stapler staple build/homebridge-standalone-*.dmg
#
# - name: Upload signed artifact
# uses: actions/upload-artifact@v4
# with:
# name: homebridge-standalone-dmg-signed
# path: build/homebridge-standalone-*.dmg
# retention-days: 90