mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00
89 lines
2.3 KiB
YAML
89 lines
2.3 KiB
YAML
name: Build macOS
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
working-directory: simpliplay
|
|
|
|
- name: Create a temporary keychain
|
|
run: |
|
|
security create-keychain -p "" build.keychain
|
|
security list-keychains -s build.keychain login.keychain-db
|
|
security unlock-keychain -p "" build.keychain
|
|
|
|
- name: Check secret presence
|
|
env:
|
|
CERT_P12_BASE64: ${{ secrets.MAC_CERTIFICATE_P12 }}
|
|
CERT_PASSWORD: "${{ secrets.MAC_CERTIFICATE_PASSWORD }}"
|
|
run: |
|
|
if [ -z "$CERT_PASSWORD" ]; then
|
|
echo "Password secret is empty or missing!"
|
|
exit 1
|
|
else
|
|
echo "Password is set"
|
|
fi
|
|
|
|
if [ -z "$CERT_P12_BASE64" ]; then
|
|
echo "P12 secret is empty or missing!"
|
|
exit 1
|
|
else
|
|
echo "P12 is set"
|
|
fi
|
|
|
|
- name: Import macOS certificate
|
|
env:
|
|
CERT_P12_BASE64: ${{ secrets.MAC_CERTIFICATE_P12 }}
|
|
CERT_PASSWORD: "${{ secrets.MAC_CERTIFICATE_PASSWORD }}"
|
|
run: |
|
|
echo "$CERT_P12_BASE64" | tr -d '\n\r ' | base64 -D > cert.p12
|
|
|
|
security import cert.p12 \
|
|
-k build.keychain \
|
|
-P "$CERT_PASSWORD" \
|
|
-T /usr/bin/codesign
|
|
|
|
security set-key-partition-list \
|
|
-S apple-tool:,apple: \
|
|
-s \
|
|
-k "" \
|
|
build.keychain
|
|
|
|
|
|
- name: Build macOS
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
CSC_KEYCHAIN: build.keychain
|
|
CSC_NAME: "Anirudh Sevugan"
|
|
CSC_KEY_PASSWORD: "${{ secrets.MAC_CERTIFICATE_PASSWORD }}"
|
|
run: npx electron-builder --mac --x64 --arm64 --universal
|
|
working-directory: simpliplay
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: builds
|
|
path: simpliplay/dist/*.dmg
|
|
|
|
- name: Delete temporary keychain
|
|
if: always()
|
|
run: |
|
|
security delete-keychain build.keychain
|