82 lines
1.9 KiB
YAML
82 lines
1.9 KiB
YAML
name: Build and Deploy Electron App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build Electron app
|
|
run: npm run build
|
|
|
|
- name: Archive built files
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: electron-build
|
|
path: dist/
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Download built files
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: electron-build
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Deploy release to GitHub
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
dist/*
|
|
tag_name: v${{ github.ref }}
|
|
title: Release ${{ github.ref }}
|
|
body: Release of ${{ github.sha }}
|
|
|
|
- name: Publish to GitHub Packages
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
repository: ${{ github.repository }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Install Dependencies
|
|
run: |
|
|
cd src
|
|
npm install
|
|
- name: Build the Electron App
|
|
run: |
|
|
cd src
|
|
npm run build
|
|
- name: Build and Publish the Electron App to GitHub Packages
|
|
uses: samuelmeuli/action-electron-builder@v2
|
|
with:
|
|
publish: always
|
|
draft: false
|
|
prerelease: false
|
|
token: ${{ secrets.GITHUB_TOKEN }} |