Build and Release Electron App #2
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 Electron App | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm i --legacy-peer-deps | |
- name: Build app | |
run: npm run build | |
- name: Package Electron app | |
run: npm run electron-pack | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app | |
path: dist/ | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: app | |
path: dist/ | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/*" | |
draft: true | |
makeLatest: true | |
token: ${{ secrets.GITHUB_TOKEN }} |