From f0be2291315e1f7cde96e5748b867e780e351152 Mon Sep 17 00:00:00 2001 From: Tharindu Jayawardhana Date: Fri, 14 Jun 2024 10:14:15 +0530 Subject: [PATCH] Update node.js.yml --- .github/workflows/node.js.yml | 69 ++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6d573d7..1a17fdd 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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