fix(electron): release desktop app workflow (#4594)

This commit is contained in:
LongYinan
2023-10-17 14:15:55 +08:00
committed by GitHub
parent 01987990ee
commit e831f612e8
14 changed files with 96 additions and 39 deletions
+8
View File
@@ -29,6 +29,9 @@ inputs:
description: 'Build plugins'
required: false
default: 'true'
nmHoistingLimits:
description: 'Set nmHoistingLimits in .yarnrc.yml'
required: false
runs:
using: 'composite'
@@ -46,6 +49,11 @@ runs:
shell: bash
run: yarn config set nmMode hardlinks-local
- name: Set nmHoistingLimits
if: ${{ inputs.nmHoistingLimits }}
shell: bash
run: yarn config set nmHoistingLimits ${{ inputs.nmHoistingLimits }}
- name: yarn install
if: ${{ inputs.package-install == 'true' }}
continue-on-error: true
+19
View File
@@ -67,6 +67,7 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.version || steps.get-canary-version.outputs.RELEASE_VERSION }}
SKIP_PLUGIN_BUILD: 'true'
- name: Upload core artifact
uses: actions/upload-artifact@v3
@@ -105,6 +106,11 @@ jobs:
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
with:
extra-flags: workspaces focus @affine/electron @affine/monorepo
hard-link-nm: false
build-plugins: false
nmHoistingLimits: workspaces
- name: Setup Maker
timeout-minutes: 10
uses: ./.github/actions/setup-maker
@@ -131,6 +137,10 @@ jobs:
- name: make
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
env:
SKIP_PLUGIN_BUILD: 1
SKIP_WEB_BUILD: 1
HOIST_NODE_MODULES: 1
- name: Save artifacts (mac)
if: ${{ matrix.spec.platform == 'darwin' }}
@@ -173,6 +183,11 @@ jobs:
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
with:
extra-flags: workspaces focus @affine/electron @affine/monorepo
hard-link-nm: false
build-plugins: false
nmHoistingLimits: workspaces
- name: Setup Maker
timeout-minutes: 10
uses: ./.github/actions/setup-maker
@@ -195,6 +210,10 @@ jobs:
- name: package
run: yarn workspace @affine/electron package --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
env:
SKIP_PLUGIN_BUILD: 1
SKIP_WEB_BUILD: 1
HOIST_NODE_MODULES: 1
- name: get all files to be signed
id: get_files_to_be_signed
+10 -8
View File
@@ -130,15 +130,17 @@ module.exports = {
packageJson.productName = productName;
},
prePackage: async () => {
await rm(path.join(__dirname, 'node_modules'), {
recursive: true,
force: true,
});
if (!process.env.HOIST_NODE_MODULES) {
await rm(path.join(__dirname, 'node_modules'), {
recursive: true,
force: true,
});
await symlink(
path.join(__dirname, '..', '..', 'node_modules'),
path.join(__dirname, 'node_modules')
);
await symlink(
path.join(__dirname, '..', '..', 'node_modules'),
path.join(__dirname, 'node_modules')
);
}
},
generateAssets: async (_, platform, arch) => {
if (process.env.SKIP_GENERATE_ASSETS) {
+1 -1
View File
@@ -52,7 +52,7 @@
"@types/uuid": "^9.0.5",
"builder-util-runtime": "^9.2.1",
"cross-env": "7.0.3",
"electron": "^26.4.0",
"electron": "^27.0.0",
"electron-log": "^5.0.0-rc.1",
"electron-squirrel-startup": "1.0.0",
"electron-window-state": "^5.0.3",
+4 -1
View File
@@ -41,9 +41,12 @@ $.env.DISTRIBUTION = 'desktop';
cd(repoRootDir);
if (!process.env.SKIP_PLUGIN_BUILD) {
await $`yarn -T run build:plugins`;
}
// step 1: build web (nextjs) dist
if (!process.env.SKIP_WEB_BUILD) {
await $`yarn -T run build:plugins`;
await $`yarn nx build @affine/core`;
await $`yarn workspace @affine/electron build`;
+2 -1
View File
@@ -85,7 +85,8 @@
"@vanilla-extract/webpack-plugin": "^2.3.1",
"@vitejs/plugin-react-swc": "^3.4.0",
"@vitest/coverage-istanbul": "0.34.6",
"@vitest/ui": "0.34.6",
"@vitest/ui": "0.34.7",
"electron": "^27.0.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-i": "^2.28.1",
+1
View File
@@ -6,6 +6,7 @@
"module": "./src/index.ts",
"devDependencies": {
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"react": "18.2.0",
"react-dom": "18.2.0",
"vitest": "0.34.6",
+1
View File
@@ -64,6 +64,7 @@
},
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly",
"@testing-library/react": "^14.0.0",
+2 -1
View File
@@ -18,6 +18,7 @@
"@vitejs/plugin-vue": "^4.4.0",
"rollup": "^3.29.4",
"rollup-plugin-swc3": "^0.10.2",
"ts-node": "^10.9.1"
"ts-node": "^10.9.1",
"vue": "^3.3.4"
}
}
+1
View File
@@ -24,6 +24,7 @@
"dependencies": {
"@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"jotai": "^2.4.3",
+14 -14
View File
@@ -1,6 +1,19 @@
/* auto-generated by NAPI-RS */
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface Blob {
contentType: string;
lastModified: string;
size: number;
data: Buffer;
}
/**
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
* result binary.
*/
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer;
export class Storage {
/** Create a storage instance and establish connection to persist store. */
static connect(
@@ -18,16 +31,3 @@ export class Storage {
/** Workspace size taken by blobs. */
blobsSize(workspaces: Array<string>): Promise<number>;
}
export interface Blob {
contentType: string;
lastModified: string;
size: number;
data: Buffer;
}
/**
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
* result binary.
*/
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer;
+2 -1
View File
@@ -43,7 +43,8 @@
"vite": "^4.4.11",
"vite-plugin-dts": "3.6.0",
"vitest": "0.34.6",
"y-indexeddb": "^9.0.11"
"y-indexeddb": "^9.0.11",
"yjs": "^13.6.8"
},
"peerDependencies": {
"yjs": "^13"
+2 -1
View File
@@ -27,7 +27,8 @@
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"vite": "^4.4.11",
"vite-plugin-dts": "3.6.0",
"vitest": "0.34.6"
"vitest": "0.34.6",
"yjs": "^13.6.8"
},
"peerDependencies": {
"yjs": "^13"
+29 -11
View File
@@ -414,7 +414,7 @@ __metadata:
async-call-rpc: ^6.3.1
builder-util-runtime: ^9.2.1
cross-env: 7.0.3
electron: ^26.4.0
electron: ^27.0.0
electron-log: ^5.0.0-rc.1
electron-squirrel-startup: 1.0.0
electron-updater: ^6.1.5
@@ -447,6 +447,7 @@ __metadata:
resolution: "@affine/env@workspace:packages/env"
dependencies:
"@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly
lit: ^2.8.0
react: 18.2.0
react-dom: 18.2.0
@@ -547,7 +548,8 @@ __metadata:
"@vanilla-extract/webpack-plugin": ^2.3.1
"@vitejs/plugin-react-swc": ^3.4.0
"@vitest/coverage-istanbul": 0.34.6
"@vitest/ui": 0.34.6
"@vitest/ui": 0.34.7
electron: ^27.0.0
eslint: ^8.51.0
eslint-config-prettier: ^9.0.0
eslint-plugin-i: ^2.28.1
@@ -630,6 +632,7 @@ __metadata:
rollup: ^3.29.4
rollup-plugin-swc3: ^0.10.2
ts-node: ^10.9.1
vue: ^3.3.4
bin:
af: ./src/af.mjs
languageName: unknown
@@ -641,6 +644,7 @@ __metadata:
dependencies:
"@blocksuite/block-std": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/store": 0.0.0-20230926212737-6d4b1569-nightly
jotai: ^2.4.3
@@ -12410,6 +12414,7 @@ __metadata:
dependencies:
"@affine-test/fixtures": "workspace:*"
"@affine/sdk": "workspace:*"
"@affine/templates": "workspace:*"
"@blocksuite/blocks": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/editor": 0.0.0-20230926212737-6d4b1569-nightly
"@blocksuite/global": 0.0.0-20230926212737-6d4b1569-nightly
@@ -12475,6 +12480,7 @@ __metadata:
vitest: 0.34.6
y-indexeddb: ^9.0.11
y-provider: "workspace:*"
yjs: ^13.6.8
peerDependencies:
yjs: ^13
languageName: unknown
@@ -14024,11 +14030,11 @@ __metadata:
languageName: node
linkType: hard
"@vitest/ui@npm:0.34.6":
version: 0.34.6
resolution: "@vitest/ui@npm:0.34.6"
"@vitest/ui@npm:0.34.7":
version: 0.34.7
resolution: "@vitest/ui@npm:0.34.7"
dependencies:
"@vitest/utils": 0.34.6
"@vitest/utils": 0.34.7
fast-glob: ^3.3.0
fflate: ^0.8.0
flatted: ^3.2.7
@@ -14037,7 +14043,7 @@ __metadata:
sirv: ^2.0.3
peerDependencies:
vitest: ">=0.30.1 <1"
checksum: aaea587823d38bf5bb1961bbfdddacd42bbcedd7a6f771d8e26f5f597267655a19527434099b11013d00100ddb25a9550d55d1a275c08763dc67407ac7d3baa1
checksum: 6d1c73ee3bb303645c62bdb4ffb87063631e1771c2dbee0a28537678d09ffc97fa9669e2de6d1cd7e469f2b48dfde88f46fb9686ee82591c24050b6723aa9758
languageName: node
linkType: hard
@@ -14052,6 +14058,17 @@ __metadata:
languageName: node
linkType: hard
"@vitest/utils@npm:0.34.7":
version: 0.34.7
resolution: "@vitest/utils@npm:0.34.7"
dependencies:
diff-sequences: ^29.4.3
loupe: ^2.3.6
pretty-format: ^29.5.0
checksum: d98b8809ada19c207ace43c88d452685adde6966b00e223ac2308b2ea7d0694bdd4d6ff9518ea505e2b5bd4d1b51f44bae430e22fa83ca32c77ad28b61209bc4
languageName: node
linkType: hard
"@volar/language-core@npm:1.10.4, @volar/language-core@npm:~1.10.4":
version: 1.10.4
resolution: "@volar/language-core@npm:1.10.4"
@@ -18853,16 +18870,16 @@ __metadata:
languageName: node
linkType: soft
"electron@npm:^26.4.0":
version: 26.4.0
resolution: "electron@npm:26.4.0"
"electron@npm:^27.0.0":
version: 27.0.0
resolution: "electron@npm:27.0.0"
dependencies:
"@electron/get": ^2.0.0
"@types/node": ^18.11.18
extract-zip: ^2.0.1
bin:
electron: cli.js
checksum: eb68e980220dee407af33e5662e53dcf9c40f2c29ff2beac76e227368377979b6d649a529b49503227b59cdb8986dd348588338710059ffa93509aa50027bbee
checksum: 4a84cb894d5f626fe7a2b5171693e903ce82a7673aabc419e5d3d0d2f9cc8441e5088524ecd86a046beab4ba7dd13820b7a94c361c3e7bc2f0959d1a1a860df5
languageName: node
linkType: hard
@@ -34485,6 +34502,7 @@ __metadata:
vite: ^4.4.11
vite-plugin-dts: 3.6.0
vitest: 0.34.6
yjs: ^13.6.8
peerDependencies:
yjs: ^13
languageName: unknown