Skip to content

Trim backend build

Trim backend build #6

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir -r backend/requirements.txt
pip install --no-cache-dir pyinstaller
- name: Install UPX (Compression)
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y upx
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install upx
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install upx
fi
- name: Install dependencies
run: npm install
- name: Build the app (Windows)
if: matrix.os == 'windows-latest'
run: npm run build:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build the app (macOS)
if: matrix.os == 'macos-latest'
run: npm run build:mac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install snapcraft
if: matrix.os == 'ubuntu-latest'
run: sudo snap install snapcraft --classic
- name: Build the app (Linux)
if: matrix.os == 'ubuntu-latest'
run: npm run build:linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/Sonosano-setup.exe
dist/Sonosano.dmg
dist/Sonosano_*.deb
dist/backend/sonosano-backend*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}