ui update and build #1
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 Publish Electron App | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-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: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Pipenv | |
run: pip install pipenv | |
- name: Install dependencies | |
run: npm install | |
- name: Build backend | |
run: | | |
cd backend | |
pipenv install | |
cd .. | |
npm run backendBuild | |
- name: Build Electron App for ${{ matrix.os }} | |
run: | | |
if [[ "${{ matrix.os }}" == 'ubuntu-latest' ]]; then | |
npm run build:linux | |
elif [[ "${{ matrix.os }}" == 'macos-latest' ]]; then | |
npm run build:mac | |
elif [[ "${{ matrix.os }}" == 'windows-latest' ]]; then | |
npm run build:win | |
fi | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-electron-app | |
path: dist/* | |
create_release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-electron-app | |
path: ./dist | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist | |
asset_name: electron-app-${{ matrix.os }}.zip | |
asset_content_type: application/zip |