mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
171 lines
4.3 KiB
YAML
171 lines
4.3 KiB
YAML
name: Build Electron app
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
apiBaseUrl:
|
|
description: "API base URL"
|
|
required: false
|
|
default: "fromchat.ru"
|
|
type: string
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- 'frontend/**'
|
|
- 'package.json'
|
|
- '.github/workflows/build.yml'
|
|
|
|
concurrency:
|
|
group: build-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: npm-ubuntu-latest-node-24-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
npm-ubuntu-latest-node-24-
|
|
|
|
- name: Install dependencies
|
|
run: npm install --ignore-scripts --no-audit --no-fund
|
|
|
|
- name: Cache Electron downloads
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/electron
|
|
~/.cache/electron-builder
|
|
key: electron-ubuntu-latest-${{ hashFiles('package.json', 'package.json') }}
|
|
restore-keys: |
|
|
electron-ubuntu-latest-
|
|
|
|
- name: Build Electron app
|
|
shell: bash
|
|
env:
|
|
VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }}
|
|
run: npm run build:electron
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: FromChat-linux
|
|
path: |
|
|
frontend/build/electron/forge/make/*/**
|
|
if-no-files-found: error
|
|
|
|
build-macos:
|
|
name: Build macOS
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: npm-macos-latest-node-24-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
npm-macos-latest-node-24-
|
|
|
|
- name: Install dependencies
|
|
run: npm install --ignore-scripts --no-audit --no-fund
|
|
|
|
# - name: Cache Electron downloads
|
|
# uses: actions/cache@v4
|
|
# with:
|
|
# path: |
|
|
# ~/.cache/electron
|
|
# ~/.cache/electron-builder
|
|
# key: electron-macos-latest-${{ hashFiles('package.json') }}
|
|
# restore-keys: |
|
|
# electron-macos-latest-
|
|
|
|
- name: Build Electron app
|
|
shell: bash
|
|
env:
|
|
VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }}
|
|
run: npm run build:electron
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: FromChat-macOS
|
|
path: |
|
|
frontend/build/electron/forge/make/zip/darwin/*/**.zip
|
|
if-no-files-found: error
|
|
|
|
build-windows:
|
|
name: Build Windows
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Force npm to use Bash
|
|
run: npm config set script-shell "C:\Program Files\Git\bin\bash.exe"
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: npm-windows-latest-node-24-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
npm-windows-latest-node-24-
|
|
|
|
- name: Install dependencies
|
|
run: npm install --ignore-scripts --no-audit --no-fund
|
|
|
|
- name: Cache Electron downloads
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~\AppData\Local\electron\Cache
|
|
~\AppData\Local\electron-builder\Cache
|
|
key: electron-windows-latest-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
electron-windows-latest-
|
|
|
|
- name: Build Electron app
|
|
shell: bash
|
|
env:
|
|
VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }}
|
|
run: npm run build:electron
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: FromChat-windows
|
|
path: |
|
|
frontend/build/electron/forge/make/zip/win32/x64
|
|
if-no-files-found: error |