Build and Release #4
Workflow file for this run
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 and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number for the release (e.g., v1.0.0)' | |
required: true | |
release_name: | |
description: 'Name of the release' | |
required: true | |
default: 'New Release' | |
draft: | |
description: 'Create as draft release?' | |
required: false | |
default: true | |
type: boolean | |
prerelease: | |
description: 'Is this a prerelease?' | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Create ui/.env file | |
run: | | |
echo "PUBLIC_WS_URL=127.0.0.1:5174/ws`nPUBLIC_DESKTOP_MODE=true" > ui/.env | |
- name: Install and build the Svelte frontend | |
run: | | |
cd ui | |
npm install | |
npm run build | |
cd .. | |
- name: Build Windows ZIP and MSI | |
run: | | |
python setup.py build | |
python setup.py bdist_msi | |
- name: Copy to dist folder | |
run: | | |
mkdir dist | |
cp build/exe.win-amd64-*\* dist/ | |
- name: Upload Windows ZIP artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-zip | |
path: dist/*.zip | |
- name: Upload Windows MSI artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-msi | |
path: dist/*.msi | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Create ui/.env file | |
run: | | |
printf "PUBLIC_WS_URL=127.0.0.1:5174/ws\nPUBLIC_DESKTOP_MODE=true" > ui/.env | |
- name: Install and build the Svelte frontend | |
run: | | |
cd ui | |
npm install | |
npm run build | |
cd .. | |
- name: Build macOS DMG | |
run: | | |
python setup.py bdist_dmg | |
- name: Upload macOS DMG artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-dmg | |
path: build/*.dmg | |
create-release: | |
needs: [build-windows, build-macos] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.version }} | |
name: ${{ github.event.inputs.release_name }} | |
draft: ${{ github.event.inputs.draft }} | |
prerelease: ${{ github.event.inputs.prerelease }} | |
files: | | |
artifacts/windows-zip/*.zip | |
artifacts/windows-msi/*.msi | |
artifacts/macos-dmg/*.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |