Skip to content

Refactor build command in windows-build.yml: Update branch filter to … #34

Refactor build command in windows-build.yml: Update branch filter to …

Refactor build command in windows-build.yml: Update branch filter to … #34

Workflow file for this run

name: Build and Publish Electron App
on:
push:
branches:
- "*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Install electron-forge globally
run: pnpm add -g @electron-forge/cli
- name: Set NODE_PATH
run: echo "NODE_PATH=$(pnpm root -g)" >> $GITHUB_ENV
- name: Clean install
run: |
rm -rf node_modules
pnpm install --force
working-directory: ./native
- name: Install dependencies
run: |
pnpm install
pnpm rebuild
working-directory: ./native
- name: Build TypeScript
run: pnpm run build
working-directory: ./native
- name: Make Electron app
run: pnpm run make
working-directory: ./native
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-build
path: native/out/make/**/*
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: |
pnpm install
pnpm rebuild
working-directory: ./native
- name: Publish Electron app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm run publish
working-directory: ./native