Merge pull request #178 from heshengtao/dev #76
Workflow file for this run
This file contains hidden or 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 and Release | |
on: | |
push: | |
tags: [ "v*.*.*" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install uv | |
uv venv | |
uv sync | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Build Python backend | |
run: uv run pyinstaller server.spec | |
- name: Copy node_modules to dist/server/_internal | |
shell: bash | |
run: | | |
mkdir -p dist/server/_internal/node_modules | |
cp -r node_modules/* dist/server/_internal/node_modules/ | |
- name: Build and Publish Electron app | |
shell: bash | |
run: | | |
case "${{ matrix.os }}" in | |
windows-latest) | |
npx electron-builder build --win --publish always | |
;; | |
ubuntu-latest) | |
npx electron-builder build --linux --publish always | |
;; | |
macos-latest) | |
npx electron-builder build --mac \ | |
--config.mac.identity=null \ | |
--config.mac.hardenedRuntime=false \ | |
--config.mac.gatekeeperAssess=false \ | |
--publish always | |
;; | |
esac | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CSC_IDENTITY_AUTO_DISCOVERY: false |