mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
build: optimize release app workflow (#2011)
This commit is contained in:
201
.github/workflows/release-desktop-app.yml
vendored
201
.github/workflows/release-desktop-app.yml
vendored
@@ -38,128 +38,102 @@ env:
|
|||||||
BUILD_TYPE: ${{ github.event.inputs.is-canary == 'true' && 'canary' || 'stable' }}
|
BUILD_TYPE: ${{ github.event.inputs.is-canary == 'true' && 'canary' || 'stable' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make-macos:
|
before-make:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
|
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
|
||||||
env:
|
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
||||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
||||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
||||||
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
||||||
API_SERVER_PROFILE: prod
|
|
||||||
|
|
||||||
runs-on: macos-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch: [x64, arm64]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
|
- name: generate-assets
|
||||||
|
working-directory: apps/electron
|
||||||
|
run: yarn generate-assets
|
||||||
|
env:
|
||||||
|
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
|
||||||
|
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
||||||
|
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
||||||
|
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
||||||
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||||
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||||
|
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
API_SERVER_PROFILE: prod
|
||||||
|
|
||||||
|
- name: Upload Artifact (web-static)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: before-make-web-static
|
||||||
|
path: apps/electron/resources/web-static
|
||||||
|
|
||||||
|
- name: Upload Artifact (electron dist)
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: before-make-electron-dist
|
||||||
|
path: apps/electron/dist
|
||||||
|
|
||||||
|
make-distribution:
|
||||||
|
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
|
||||||
|
strategy:
|
||||||
|
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
|
||||||
|
matrix:
|
||||||
|
spec:
|
||||||
|
- { os: ubuntu-latest, arch: x64 }
|
||||||
|
- { os: macos-latest, arch: x64 }
|
||||||
|
- { os: macos-latest, arch: arm64 }
|
||||||
|
- { os: windows-latest, arch: x64 }
|
||||||
|
runs-on: ${{ matrix.spec.os }}
|
||||||
|
needs: before-make
|
||||||
|
env:
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
SKIP_GENERATE_ASSETS: 1
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: before-make-web-static
|
||||||
|
path: apps/electron/resources/web-static
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: before-make-electron-dist
|
||||||
|
path: apps/electron/dist
|
||||||
|
|
||||||
- name: Signing By Apple Developer ID
|
- name: Signing By Apple Developer ID
|
||||||
|
if: ${{ matrix.spec.os == 'macos-latest' }}
|
||||||
uses: apple-actions/import-codesign-certs@v2
|
uses: apple-actions/import-codesign-certs@v2
|
||||||
with:
|
with:
|
||||||
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
||||||
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
||||||
|
|
||||||
- name: make build
|
- name: make
|
||||||
run: yarn make-macos-${{ matrix.arch }}
|
run: yarn make-${{ matrix.spec.os == 'macos-latest' && 'macos' || matrix.spec.os == 'windows-latest' && 'windows' || 'linux' }}-${{ matrix.spec.arch || 'x64' }}
|
||||||
working-directory: apps/electron
|
working-directory: apps/electron
|
||||||
|
|
||||||
- name: Save artifacts
|
- name: Save artifacts (mac)
|
||||||
|
if: ${{ matrix.spec.os == 'macos-latest' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv apps/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-darwin-${{ matrix.arch }}.dmg
|
mv apps/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-darwin-${{ matrix.arch }}.dmg
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Save artifacts (windows)
|
||||||
uses: actions/upload-artifact@v3
|
if: ${{ matrix.spec.os == 'windows-latest' }}
|
||||||
with:
|
|
||||||
name: affine-darwin-${{ matrix.arch }}-builds
|
|
||||||
path: builds
|
|
||||||
|
|
||||||
make-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
|
|
||||||
env:
|
|
||||||
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
||||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
||||||
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
||||||
API_SERVER_PROFILE: prod
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: ./.github/actions/setup-node
|
|
||||||
|
|
||||||
- name: make build
|
|
||||||
run: yarn make-windows-x64
|
|
||||||
working-directory: apps/electron
|
|
||||||
|
|
||||||
- name: Save windows artifacts
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
|
mv apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
|
||||||
mv apps/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.exe
|
mv apps/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.exe
|
||||||
mv apps/electron/out/*/make/squirrel.windows/x64/*.msi ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.msi
|
mv apps/electron/out/*/make/squirrel.windows/x64/*.msi ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.msi
|
||||||
mv apps/electron/out/*/make/squirrel.windows/x64/*.nupkg ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.nupkg
|
mv apps/electron/out/*/make/squirrel.windows/x64/*.nupkg ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.nupkg
|
||||||
mv apps/electron/out/*/make/squirrel.windows/x64/RELEASES ./builds/RELEASES
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: affine-windows-x64-builds
|
|
||||||
path: builds
|
|
||||||
|
|
||||||
make-linux:
|
- name: Save artifacts (linux)
|
||||||
runs-on: ubuntu-latest
|
if: ${{ matrix.spec.os == 'ubuntu-latest' }}
|
||||||
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
|
|
||||||
env:
|
|
||||||
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
|
|
||||||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
|
|
||||||
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
|
|
||||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
||||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
||||||
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
||||||
API_SERVER_PROFILE: prod
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: ./.github/actions/setup-node
|
|
||||||
|
|
||||||
- name: make build
|
|
||||||
run: yarn make
|
|
||||||
working-directory: apps/electron
|
|
||||||
|
|
||||||
- name: Save Linux artifacts
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.zip
|
mv apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.zip
|
||||||
@@ -167,33 +141,26 @@ jobs:
|
|||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: affine-Linux-x64-builds
|
name: affine-${{ matrix.spec.os }}-${{ matrix.spec.arch }}-builds
|
||||||
path: builds
|
path: builds
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [make-macos, make-windows, make-linux]
|
needs: make-distribution
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
|
||||||
|
matrix:
|
||||||
|
spec:
|
||||||
|
- { os: ubuntu-latest, arch: x64 }
|
||||||
|
- { os: macos-latest, arch: x64 }
|
||||||
|
- { os: macos-latest, arch: arm64 }
|
||||||
|
- { os: windows-latest, arch: x64 }
|
||||||
steps:
|
steps:
|
||||||
- name: Download MacOS x64 Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: affine-darwin-x64-builds
|
name: affine-${{ matrix.spec.os }}-${{ matrix.spec.arch }}-builds
|
||||||
path: ./
|
|
||||||
|
|
||||||
- name: Download MacOS arm64 Artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: affine-darwin-arm64-builds
|
|
||||||
path: ./
|
|
||||||
- name: Download Windows Artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: affine-windows-x64-builds
|
|
||||||
path: ./
|
|
||||||
- name: Download Linux Artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: affine-Linux-x64-builds
|
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Create Release Draft
|
- name: Create Release Draft
|
||||||
|
|||||||
@@ -72,8 +72,14 @@ module.exports = {
|
|||||||
packageJson.productName = productName;
|
packageJson.productName = productName;
|
||||||
},
|
},
|
||||||
generateAssets: async (_, platform, arch) => {
|
generateAssets: async (_, platform, arch) => {
|
||||||
|
if (process.env.SKIP_GENERATE_ASSETS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { $ } = await import('zx');
|
const { $ } = await import('zx');
|
||||||
|
|
||||||
|
// TODO: right now we do not need the following
|
||||||
|
// it is for octobase-node, but we dont use it for now.
|
||||||
if (platform === 'darwin' && arch === 'arm64') {
|
if (platform === 'darwin' && arch === 'arm64') {
|
||||||
// In GitHub Actions runner, MacOS is always x64
|
// In GitHub Actions runner, MacOS is always x64
|
||||||
// we need to manually set TARGET to aarch64-apple-darwin
|
// we need to manually set TARGET to aarch64-apple-darwin
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { isMacOS } from '../../utils';
|
|||||||
*/
|
*/
|
||||||
contextBridge.exposeInMainWorld('apis', {
|
contextBridge.exposeInMainWorld('apis', {
|
||||||
workspaceSync: (id: string) => ipcRenderer.invoke('octo:workspace-sync', id),
|
workspaceSync: (id: string) => ipcRenderer.invoke('octo:workspace-sync', id),
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
onThemeChange: (theme: string) =>
|
onThemeChange: (theme: string) =>
|
||||||
ipcRenderer.invoke('ui:theme-change', theme),
|
ipcRenderer.invoke('ui:theme-change', theme),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
|
"make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
|
||||||
"make-macos-x64": "electron-forge make --platform=darwin --arch=x64",
|
"make-macos-x64": "electron-forge make --platform=darwin --arch=x64",
|
||||||
"make-windows-x64": "electron-forge make --platform=win32 --arch=x64",
|
"make-windows-x64": "electron-forge make --platform=win32 --arch=x64",
|
||||||
"postinstall": "ELECTRON_RUN_AS_NODE=1 electron scripts/update-electron-vendors.mjs"
|
"make-linux-x64": "electron-forge make --platform=linux --arch=x64"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"forge": "./forge.config.js"
|
"forge": "./forge.config.js"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 62 KiB |
@@ -1,13 +1,5 @@
|
|||||||
import fs from 'node:fs';
|
|
||||||
import path from 'node:path';
|
const NODE_MAJOR_VERSION = 18;
|
||||||
import * as url from 'node:url';
|
|
||||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
||||||
const { node } = JSON.parse(
|
|
||||||
fs.readFileSync(
|
|
||||||
path.join(__dirname, '../electron-vendors.autogen.json'),
|
|
||||||
'utf-8'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const nativeNodeModulesPlugin = {
|
const nativeNodeModulesPlugin = {
|
||||||
name: 'native-node-modules',
|
name: 'native-node-modules',
|
||||||
@@ -35,7 +27,7 @@ export default () => {
|
|||||||
entryPoints: ['layers/main/src/index.ts'],
|
entryPoints: ['layers/main/src/index.ts'],
|
||||||
outdir: 'dist/layers/main',
|
outdir: 'dist/layers/main',
|
||||||
bundle: true,
|
bundle: true,
|
||||||
target: `node${node}`,
|
target: `node${NODE_MAJOR_VERSION}`,
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
external: ['electron'],
|
external: ['electron'],
|
||||||
plugins: [nativeNodeModulesPlugin],
|
plugins: [nativeNodeModulesPlugin],
|
||||||
@@ -45,7 +37,7 @@ export default () => {
|
|||||||
entryPoints: ['layers/preload/src/index.ts'],
|
entryPoints: ['layers/preload/src/index.ts'],
|
||||||
outdir: 'dist/layers/preload',
|
outdir: 'dist/layers/preload',
|
||||||
bundle: true,
|
bundle: true,
|
||||||
target: `node${node}`,
|
target: `node${NODE_MAJOR_VERSION}`,
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
external: ['electron'],
|
external: ['electron'],
|
||||||
define: define,
|
define: define,
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* This script should be run in electron context
|
|
||||||
* @example
|
|
||||||
* ELECTRON_RUN_AS_NODE=1 electron scripts/update-electron-vendors.mjs
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { writeFileSync } from 'fs';
|
|
||||||
|
|
||||||
const electronRelease = process.versions;
|
|
||||||
|
|
||||||
const node = electronRelease.node.split('.')[0];
|
|
||||||
const chrome = electronRelease.v8.split('.').splice(0, 2).join('');
|
|
||||||
|
|
||||||
writeFileSync(
|
|
||||||
'./electron-vendors.autogen.json',
|
|
||||||
JSON.stringify({ chrome, node })
|
|
||||||
);
|
|
||||||
Reference in New Issue
Block a user