Skip to content

Build Desktop Apps

Build Desktop Apps #34

name: Build macOS App
on:
release:
types: [prereleased]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.16.0"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Download and extract libsimple
run: |
curl -L https://github.com/wangfenjin/simple/releases/latest/download/libsimple-osx-x64.zip -o libsimple.zip
unzip libsimple.zip
libsimple_dir=$(ls -d libsimple* | head -n 1)
if [ -d "$libsimple_dir" ]; then
mv "$libsimple_dir" dist-simple
else
mkdir dist-simple
mv libsimple* dist-simple/
fi
ls -R dist-simple
shell: bash
- name: Install dependencies
run: pnpm install
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- name: Build application
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: pnpm run build:desktop
- name: Build and Sign
env:
APPLEID: ${{ secrets.APPLE_ID }}
APPLEIDPASS: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLETEAMID: ${{ secrets.APPLE_TEAM_ID }}
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: pnpm run pkg:desktop
- name: List dist-app contents
run: ls -la dist-app
- name: Update Release
uses: softprops/action-gh-release@v2
with:
files: |
dist-app/*.dmg
dist-app/*.zip
dist-app/latest*.yml
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}