fix vite #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Electron App | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Install Vite | |
run: npm install vite | |
- name: Build frontend with Vite | |
run: | | |
cd frontend | |
npx vite build | |
- name: Prepare for code signing | |
if: matrix.os == 'macos-latest' | |
run: | | |
mkdir -p ~/private_keys/ | |
echo "${{ secrets.MAC_CERTS }}" | base64 --decode > ~/private_keys/certs.p12 | |
security create-keychain -p "" build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
security import ~/private_keys/certs.p12 -k build.keychain -P "${{ secrets.MAC_CERTS_PASSWORD }}" -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain | |
- name: Build/release Electron app (macOS) | |
if: matrix.os == 'macos-latest' | |
uses: samuelmeuli/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
publish: always | |
env: | |
CSC_LINK: file:///Users/runner/private_keys/certs.p12 | |
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }} | |
- name: Build/release Electron app (non-macOS) | |
if: matrix.os != 'macos-latest' | |
uses: samuelmeuli/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
publish: always |