Skip to content

Update build_electron_app.yml #37

Update build_electron_app.yml

Update build_electron_app.yml #37

name: Build and Package Electron App
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
version-bump:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure all tags are fetched
- name: Bump version and push tag
uses: phips28/gh-action-bump-version
with:
github-token: ${{ secrets.GH_TOKEN }}
tag-prefix: ''
minor: true # Change this to 'true' for minor, 'false' for patch updates
build:
needs: version-bump
runs-on: windows-latest # Focused on Windows to generate .exe
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build and Package
run: npm run dist --publish=never
- name: Upload EXE Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-exe
path: dist/*.exe
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: Windows-latest-exe
path: dist
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*.exe
token: ${{ secrets.GH_TOKEN }}