Skip to content

Commit

Permalink
Update node.js.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTharz committed Jun 14, 2024
1 parent 2e607f5 commit f0be229
Showing 1 changed file with 51 additions and 18 deletions.
69 changes: 51 additions & 18 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Electron CI/CD

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Checkout Repository
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Build Application
run: npm run build

- name: Package Electron App
run: |
yarn electron:package:mac
yarn electron:package:win
yarn electron:package:linux
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false

- name: Upload macOS Package
uses: actions/upload-artifact@v2
with:
name: macOS Package
path: ./dist/*.dmg

- name: Upload Windows Package
uses: actions/upload-artifact@v2
with:
name: Windows Package
path: ./dist/*.exe

- name: Upload Linux Package
uses: actions/upload-artifact@v2
with:
name: Linux Package
path: ./dist/*.deb

0 comments on commit f0be229

Please sign in to comment.