From 57d1b58f2d2750eb1d550fa123915506164c0082 Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:09:19 -0500 Subject: [PATCH 01/10] Fix incorrect command name when running check-cmd() --- scripts/_utils.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/_utils.sh b/scripts/_utils.sh index 21cbd4c..97c4716 100755 --- a/scripts/_utils.sh +++ b/scripts/_utils.sh @@ -1,15 +1,15 @@ -export WORKSPACE_DIR=`realpath $(dirname $0)/..` +export WORKSPACE_DIR=$(realpath $(dirname $0)/..) export WORKSPACE_BUILD_DIR="${WORKSPACE_DIR}/build" function log() { - caller=`basename "$0"` + caller=$(basename "$0") echo "[${caller%.*}]: $@" } function check-cmd() { for cmd_name in "$@"; do - if ! command -v ${cmd_name} > /dev/null; then - log "Missing required command dependency: $1" + if ! command -v ${cmd_name} >/dev/null; then + log "Missing required command dependency: $cmd_name" exit -1 fi done @@ -26,7 +26,7 @@ function check-env() { function workdir() { mkdir -p "$1" - pushd "$1" > /dev/null + pushd "$1" >/dev/null } if [ "${NOTION_REPACKAGED_DEBUG}" = true ]; then From dd1324c8a4a720ada582f37738e1cc275c824064 Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:09:23 -0500 Subject: [PATCH 02/10] Bump Node, Electron and Notion executable versions --- .github/workflows/notion-repackaged.yml | 18 ++++++++++++------ .node-version | 2 +- notion-repackaged.sh | 6 +++--- scripts/build-locally.sh | 8 ++++---- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 6c3ba94..968ea3a 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -4,8 +4,8 @@ on: push: branches: [main] paths: - - 'notion-repackaged.sh' - - '.github/workflows/notion-repackaged.yml' + - "notion-repackaged.sh" + - ".github/workflows/notion-repackaged.yml" workflow_dispatch: inputs: {} @@ -110,7 +110,13 @@ jobs: build-app: name: Build app - needs: [make-vanilla-sources, make-enhanced-sources, preload-variables, create-release] + needs: + [ + make-vanilla-sources, + make-enhanced-sources, + preload-variables, + create-release, + ] runs-on: ${{ matrix.os }} env: NOTION_VERSION: ${{ needs.preload-variables.outputs.notion_version }} @@ -135,7 +141,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 22 - name: Retrieve saved sources uses: actions/download-artifact@v2 with: @@ -154,7 +160,7 @@ jobs: run: npx patch-package - name: Install electron and electron-builder working-directory: ${{ matrix.edition }}-src - run: npm install electron@11 electron-builder --save-dev + run: npm install electron@33.2.0 electron-builder --save-dev - name: Run electron-builder working-directory: ${{ matrix.edition }}-src env: @@ -176,4 +182,4 @@ jobs: steps: - uses: geekyeggo/delete-artifact@v1 with: - name: '${{ matrix.edition }}-sources' + name: "${{ matrix.edition }}-sources" diff --git a/.node-version b/.node-version index c951f07..fdb2eaa 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -14.17.1 \ No newline at end of file +22.11.0 \ No newline at end of file diff --git a/notion-repackaged.sh b/notion-repackaged.sh index 326e0aa..3d1d710 100755 --- a/notion-repackaged.sh +++ b/notion-repackaged.sh @@ -4,13 +4,13 @@ # # Version of the original Notion App installer to repackage -export NOTION_VERSION=2.0.18 +export NOTION_VERSION=4.0.0 # Revision of the current version -export NOTION_REPACKAGED_REVISION=1 +export NOTION_REPACKAGED_REVISION=1.1 # The md5sum hash of the downloaded .exe for the installer -export NOTION_DOWNLOAD_HASH=31bb8b9d547cb5385b9f04017214a206 +export NOTION_DOWNLOAD_HASH=9f9cd21ff2245fc27c2ceef224008720 # The commit of notion-enhancer/desktop to target export NOTION_ENHANCER_DESKTOP_COMMIT=832db26d2e6a247d9e76847b2de50435fa7c40d2 diff --git a/scripts/build-locally.sh b/scripts/build-locally.sh index 18823a0..141b5cb 100755 --- a/scripts/build-locally.sh +++ b/scripts/build-locally.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -source `dirname $0`/_utils.sh +source $(dirname $0)/_utils.sh workdir ${WORKSPACE_BUILD_DIR} check-cmd jq git @@ -26,7 +26,7 @@ if [ ! -d "${NOTION_REPACKAGED_EDITION_SRCDIR}" ]; then exit -1 fi -pushd "${NOTION_REPACKAGED_EDITION_SRCDIR}" > /dev/null +pushd "${NOTION_REPACKAGED_EDITION_SRCDIR}" >/dev/null log "Installing dependencies..." npm install @@ -35,10 +35,10 @@ log "Running patch-package" npx patch-package log "Install electron and electron-builder..." -npm install electron@11 electron-builder --save-dev +npm install electron@33.2.0 electron-builder --save-dev log "Running electron-builder..." node_modules/.bin/electron-builder \ --config $WORKSPACE_DIR/electron-builder.js $@ -popd > /dev/null +popd >/dev/null From 802ec4b3c41232b9ac35dc820f67d060a7835b1b Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:33:02 -0500 Subject: [PATCH 03/10] Bump actions versions --- .github/workflows/notion-repackaged.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 968ea3a..b2bc61d 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -18,7 +18,7 @@ jobs: name: Preload variables runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: preload-variables name: Load variables and set them as outputs run: | @@ -43,8 +43,8 @@ jobs: runs-on: ubuntu-latest needs: [preload-variables] steps: - - uses: actions/checkout@v2 - - uses: release-drafter/release-drafter@v5 + - uses: actions/checkout@v4 + - uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -59,7 +59,7 @@ jobs: NOTION_VERSION: ${{ needs.preload-variables.outputs.notion_version }} NOTION_REPACKAGED_REVISION: ${{ needs.preload-variables.outputs.notion_repackaged_revision }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install moreutils run: sudo apt-get install -y moreutils - name: Download official Windows build @@ -72,7 +72,7 @@ jobs: working-directory: build run: 7z a vanilla-src.zip vanilla-src - name: Save vanilla sources as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: vanilla-sources path: build/vanilla-src.zip @@ -82,13 +82,13 @@ jobs: needs: [make-vanilla-sources, preload-variables] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install icnsutils and moreutils run: sudo apt-get install -y icnsutils moreutils - name: Force to use HTTPS instead of SSH run: git config --global url."https://github.com/".insteadOf "git@github.com:" - name: Retrieve saved vanilla sources - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: vanilla-sources path: build/vanilla-src.zip @@ -103,7 +103,7 @@ jobs: working-directory: build run: 7z a enhanced-src.zip enhanced-src - name: Save enhanced sources as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: enhanced-sources path: build/enhanced-src.zip @@ -138,12 +138,12 @@ jobs: - target: macos edition: vanilla steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 22 - name: Retrieve saved sources - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ${{ matrix.edition }}-sources path: sources.zip @@ -180,6 +180,6 @@ jobs: edition: [vanilla, enhanced] runs-on: ubuntu-latest steps: - - uses: geekyeggo/delete-artifact@v1 + - uses: geekyeggo/delete-artifact@v5 with: name: "${{ matrix.edition }}-sources" From 4398c0da5486c48401e3723ee20261c10c24621b Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:38:47 -0500 Subject: [PATCH 04/10] REMOVE ME - Temporarily enable workflow on branch bump-notion-v400 --- .github/workflows/notion-repackaged.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index b2bc61d..3131968 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -2,7 +2,7 @@ name: Notion Repackaged Main on: push: - branches: [main] + branches: [main, bump-notion-v400] paths: - "notion-repackaged.sh" - ".github/workflows/notion-repackaged.yml" From 463c8a34bbb0d6f48052951c257fb55ea7c82c9d Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:41:52 -0500 Subject: [PATCH 05/10] Migrate from set-output to save-state https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/gemfury-upload.yml | 10 +++++----- .github/workflows/notion-repackaged.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gemfury-upload.yml b/.github/workflows/gemfury-upload.yml index 8427fcf..7769824 100644 --- a/.github/workflows/gemfury-upload.yml +++ b/.github/workflows/gemfury-upload.yml @@ -10,9 +10,9 @@ on: description: Release tag required: true env: - RELEASES_URL: 'https://github.com/notion-enhancer/notion-repackaged/releases' + RELEASES_URL: "https://github.com/notion-enhancer/notion-repackaged/releases" RELEASE_VERSION: "${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.release_tag }}" - GEMFURY_PUSH_URL: 'push.fury.io/notion-repackaged/' + GEMFURY_PUSH_URL: "push.fury.io/notion-repackaged/" jobs: strip-revision: @@ -22,7 +22,7 @@ jobs: - id: strip-revision run: | RELEASE_VERSION_REV_STRIPPED=$(echo $RELEASE_VERSION | sed 's/^v//') - echo "::set-output name=release_version_rev_stripped::$RELEASE_VERSION_REV_STRIPPED" + echo "::save-state name=release_version_rev_stripped::$RELEASE_VERSION_REV_STRIPPED" outputs: release_version_rev_stripped: ${{ steps.strip-revision.outputs.release_version_rev_stripped }} @@ -37,9 +37,9 @@ jobs: package_name: [notion-app, notion-app-enhanced] include: - package_type: deb - filename_format: '{0}_{1}_amd64.deb' + filename_format: "{0}_{1}_amd64.deb" - package_type: rpm - filename_format: '{0}-{1}.x86_64.rpm' + filename_format: "{0}-{1}.x86_64.rpm" steps: - name: Reupload artifacts to Gemfury env: diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 3131968..ce0d922 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -24,13 +24,13 @@ jobs: run: | source notion-repackaged.sh - echo "::set-output name=notion_version::$NOTION_VERSION" - echo "::set-output name=notion_repackaged_revision::$NOTION_REPACKAGED_REVISION" - echo "::set-output name=notion_download_hash::$NOTION_DOWNLOAD_HASH" - echo "::set-output name=notion_enhancer_desktop_commit::$NOTION_ENHANCER_DESKTOP_COMMIT" + echo "::save-state name=notion_version::$NOTION_VERSION" + echo "::save-state name=notion_repackaged_revision::$NOTION_REPACKAGED_REVISION" + echo "::save-state name=notion_download_hash::$NOTION_DOWNLOAD_HASH" + echo "::save-state name=notion_enhancer_desktop_commit::$NOTION_ENHANCER_DESKTOP_COMMIT" NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}" - echo "::set-output name=notion_repackaged_version_rev::$NOTION_REPACKAGED_VERSION_REV" + echo "::save-state name=notion_repackaged_version_rev::$NOTION_REPACKAGED_VERSION_REV" outputs: notion_version: ${{ steps.preload-variables.outputs.notion_version }} notion_repackaged_revision: ${{ steps.preload-variables.outputs.notion_repackaged_revision }} From 9a08b4b7445b8b05b01472fc0350a862f8d8c3ec Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Sun, 17 Nov 2024 19:46:51 -0500 Subject: [PATCH 06/10] Migrate from save-state to environment files https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/gemfury-upload.yml | 2 +- .github/workflows/notion-repackaged.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gemfury-upload.yml b/.github/workflows/gemfury-upload.yml index 7769824..bb782ea 100644 --- a/.github/workflows/gemfury-upload.yml +++ b/.github/workflows/gemfury-upload.yml @@ -22,7 +22,7 @@ jobs: - id: strip-revision run: | RELEASE_VERSION_REV_STRIPPED=$(echo $RELEASE_VERSION | sed 's/^v//') - echo "::save-state name=release_version_rev_stripped::$RELEASE_VERSION_REV_STRIPPED" + echo "release_version_rev_stripped=$RELEASE_VERSION_REV_STRIPPED" >> $GITHUB_OUTPUT outputs: release_version_rev_stripped: ${{ steps.strip-revision.outputs.release_version_rev_stripped }} diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index ce0d922..18cbb73 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -24,19 +24,19 @@ jobs: run: | source notion-repackaged.sh - echo "::save-state name=notion_version::$NOTION_VERSION" - echo "::save-state name=notion_repackaged_revision::$NOTION_REPACKAGED_REVISION" - echo "::save-state name=notion_download_hash::$NOTION_DOWNLOAD_HASH" - echo "::save-state name=notion_enhancer_desktop_commit::$NOTION_ENHANCER_DESKTOP_COMMIT" + echo "notion_version=$NOTION_VERSION" >> $GITHUB_OUTPUT + echo "notion_repackaged_revision=$NOTION_REPACKAGED_REVISION" >> $GITHUB_OUTPUT + echo "notion_download_hash=$NOTION_DOWNLOAD_HASH" >> $GITHUB_OUTPUT + echo "notion_enhancer_desktop_commit=$NOTION_ENHANCER_DESKTOP_COMMIT" >> $GITHUB_OUTPUT NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}" - echo "::save-state name=notion_repackaged_version_rev::$NOTION_REPACKAGED_VERSION_REV" + echo "notion_repackaged_version_rev=$NOTION_REPACKAGED_VERSION_REV" >> $GITHUB_OUTPUT outputs: notion_version: ${{ steps.preload-variables.outputs.notion_version }} notion_repackaged_revision: ${{ steps.preload-variables.outputs.notion_repackaged_revision }} - notion_repackaged_version_rev: ${{ steps.preload-variables.outputs.notion_repackaged_version_rev }} notion_download_hash: ${{ steps.preload-variables.outputs.notion_download_hash }} notion_enhancer_desktop_commit: ${{ steps.preload-variables.outputs.notion_enhancer_desktop_commit }} + notion_repackaged_version_rev: ${{ steps.preload-variables.outputs.notion_repackaged_version_rev }} create-release: name: Create release From b0c412299716980bc0faae23be74602825d2c43e Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Mon, 18 Nov 2024 00:46:47 -0500 Subject: [PATCH 07/10] Patches for Notion 4.0 --- electron-builder.js | 42 +++++++++++++++++++++++---------------- scripts/build-locally.sh | 6 +++++- scripts/extract-src.sh | 43 +++++++++++++++++++++++++--------------- 3 files changed, 57 insertions(+), 34 deletions(-) diff --git a/electron-builder.js b/electron-builder.js index f1591fd..b5a083c 100644 --- a/electron-builder.js +++ b/electron-builder.js @@ -6,23 +6,30 @@ function ensureEnvVar(envVarName) { return process.env[envVarName]; } -const editionEnvVar = ensureEnvVar('NOTION_REPACKAGED_EDITION'), - versionEnvVar = ensureEnvVar('NOTION_VERSION'), - revisionEnvVar = ensureEnvVar('NOTION_REPACKAGED_REVISION'); +const envVars = { + Edition: ensureEnvVar('NOTION_REPACKAGED_EDITION'), + Version: ensureEnvVar('NOTION_VERSION'), + Revision: ensureEnvVar('NOTION_REPACKAGED_REVISION'), +} -const isVanilla = editionEnvVar === 'vanilla'; +const isVanilla = envVars.Edition === 'vanilla'; -const productName = isVanilla ? 'Notion' : 'Notion Enhanced', - productId = isVanilla ? 'notion-app' : 'notion-app-enhanced', - conflictProductId = !isVanilla ? 'notion-app' : 'notion-app-enhanced', - productDescription = isVanilla - ? 'The all-in-one workspace for your notes and tasks' - : 'The all-in-one workspace for your notes and tasks, but enhanced'; +const productMetadata = isVanilla ? { + name: 'Notion', + description: 'The all-in-one workspace for your notes and tasks', + id: 'notion-app', + conflictId: 'notion-app-enhanced', +} : { + name: 'Notion Enhanced', + description: 'The all-in-one workspace for your notes and tasks, but enhanced', + id: 'notion-app-enhanced', + conflictId: 'notion-app', +} const fpmOptions = [ - `--version=${versionEnvVar}`, - `--iteration=${revisionEnvVar}`, - `--conflicts=${conflictProductId}`, + `--version=${envVars.Version}`, + `--iteration=${envVars.Revision}`, + `--conflicts=${productMetadata.conflictId}`, ]; const combineTargetAndArch = (targets, architectures = ['x64', 'arm64']) => @@ -38,12 +45,13 @@ const getPublishProviders = (platform) => [ module.exports = { asar: true, - productName: productName, + productName: productMetadata.name, extraMetadata: { - description: productDescription, + description: productMetadata.description, }, appId: 'com.github.notion-repackaged', protocols: [{ name: 'Notion', schemes: ['notion'] }], + npmRebuild: false, win: { icon: 'icon.ico', target: combineTargetAndArch(['nsis', 'zip'], ['x64']), @@ -62,9 +70,9 @@ module.exports = { mimeTypes: ['x-scheme-handler/notion'], desktop: { StartupNotify: 'true', - StartupWMClass: productId, + StartupWMClass: productMetadata.id, }, - target: combineTargetAndArch(['AppImage', 'deb', 'rpm', 'pacman', 'zip']), + target: combineTargetAndArch(['AppImage', 'deb', 'pacman', 'zip']), // FIXME: RPM build is broken, add ", 'rpm'" when fixed publish: getPublishProviders('linux'), }, nsis: { diff --git a/scripts/build-locally.sh b/scripts/build-locally.sh index 141b5cb..6353f53 100755 --- a/scripts/build-locally.sh +++ b/scripts/build-locally.sh @@ -35,8 +35,12 @@ log "Running patch-package" npx patch-package log "Install electron and electron-builder..." -npm install electron@33.2.0 electron-builder --save-dev +npm install electron@33.1.0 electron-builder electron-rebuild --save-dev +log "Rebuilding native modules..." +npx electron-rebuild -f -w better-sqlite3 + +# Hint: Prefix the command with `DEBUG=electron-builder` to enable debug mode log "Running electron-builder..." node_modules/.bin/electron-builder \ --config $WORKSPACE_DIR/electron-builder.js $@ diff --git a/scripts/extract-src.sh b/scripts/extract-src.sh index a83d932..2fbb6b1 100755 --- a/scripts/extract-src.sh +++ b/scripts/extract-src.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -e -source `dirname $0`/_utils.sh +source $(dirname $0)/_utils.sh workdir ${WORKSPACE_BUILD_DIR} -check-cmd 7z jq convert sponge +check-cmd 7z jq convert sponge asar check-env NOTION_VERSION NOTION_REPACKAGED_REVISION if [ -d "${NOTION_EXTRACTED_EXE_NAME}" ]; then @@ -16,7 +16,7 @@ export NOTION_DOWNLOADED_NAME="Notion-${NOTION_VERSION}.exe" log "Extracting Windows installer contents..." 7z x -y "${NOTION_DOWNLOADED_NAME}" \ - -o"${NOTION_EXTRACTED_EXE_NAME}" > /dev/null + -o"${NOTION_EXTRACTED_EXE_NAME}" >/dev/null if [ -d "${NOTION_EXTRACTED_APP_NAME}" ]; then log "Removing already extracted app contents..." @@ -25,38 +25,44 @@ fi log "Extracting Windows app resources..." 7z x -y "${NOTION_EXTRACTED_EXE_NAME}/\$PLUGINSDIR/app-64.7z" \ - -o"${NOTION_EXTRACTED_APP_NAME}" > /dev/null + -o"${NOTION_EXTRACTED_APP_NAME}" >/dev/null if [ -d "${NOTION_VANILLA_SRC_NAME}" ]; then log "Removing already extracted app sources..." rm -r "${NOTION_VANILLA_SRC_NAME}" fi +log "Extracting app.asar contents..." +asar extract "${NOTION_EXTRACTED_APP_NAME}/resources/app.asar" \ + "${NOTION_EXTRACTED_APP_NAME}/resources/app/" >/dev/null + log "Copying original app resources..." mkdir -p "${NOTION_VANILLA_SRC_NAME}" -cp -r "${NOTION_EXTRACTED_APP_NAME}/resources/app/"* "${NOTION_VANILLA_SRC_NAME}" +cp -r "${NOTION_EXTRACTED_APP_NAME}/resources/app/." "${NOTION_VANILLA_SRC_NAME}" export NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}" -pushd "${NOTION_VANILLA_SRC_NAME}" > /dev/null +pushd "${NOTION_VANILLA_SRC_NAME}" >/dev/null log "Patching and cleaning source" rm -r node_modules # behave like windows for OS other than Mac (Windows and Linux) -sed -i 's|process.platform === "win32"|process.platform !== "darwin"|g' main/main.js +sed -i 's|"win32"===process.platform|"darwin"!==process.platform|g' .webpack/main/index.js + +sed -i 's|,(0,u.initializeAutoUpdater)()||g' .webpack/main/index.js -# fix for issues #37, #65 of notion-repackaged (temporary fix) -sed -i 's|sqliteServerEnabled: true|sqliteServerEnabled: false|g' renderer/preload.js +# # fix for issues #37, #65 of notion-repackaged (temporary fix) +# sed -i 's|sqliteServerEnabled: true|sqliteServerEnabled: false|g' renderer/preload.js -# fix for issue #63 of notion-repackaged -sed -i 's|error.message.indexOf("/opt/notion-app/app.asar") !== -1|process.platform === "linux"|g' main/autoUpdater.js +# # fix for issue #63 of notion-repackaged +# sed -i 's|error.message.indexOf("/opt/notion-app/app.asar") !== -1|process.platform === "linux"|g' main/autoUpdater.js -# fix for issue #46 of notion-repackaged -patch -p0 --binary < "${WORKSPACE_DIR}/patches/no-sandbox-flag.patch" +# # fix for issue #46 of notion-repackaged +# patch -p0 --binary <"${WORKSPACE_DIR}/patches/no-sandbox-flag.patch" -find . -type f -name "*.js.map" -exec rm {} + +# find . -type f -name "*.js.map" -exec rm {} + log "Adapting package.json including fixes..." @@ -70,11 +76,16 @@ jq \ .homepage=$homepage | .repository=$repo | .author=$author | - .version=$version' \ + .version=$version | + del(.scripts.postinstall) | + del(.dependencies["@notionhq/shared"]) | + del(.dependencies["@notionhq/shared-intl"]) | + del(.dependencies["@notionhq/shared-utils"]) | + del(.dependencies["@notionhq/test-framework"])' \ package.json | sponge package.json log "Converting app icon to png..." convert "icon.ico[0]" "icon.png" -popd > /dev/null +popd >/dev/null From cdd384a3a113680644cc839f16266a1a1f1a196c Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Mon, 18 Nov 2024 00:53:44 -0500 Subject: [PATCH 08/10] REVERT ME: Make pipeline trigger more generic for testing purposes --- .github/workflows/notion-repackaged.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 18cbb73..02b1fd4 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -3,9 +3,6 @@ name: Notion Repackaged Main on: push: branches: [main, bump-notion-v400] - paths: - - "notion-repackaged.sh" - - ".github/workflows/notion-repackaged.yml" workflow_dispatch: inputs: {} From 74d6c5fc0c5b5ac423478af9af71384bbdd91892 Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Mon, 18 Nov 2024 00:56:53 -0500 Subject: [PATCH 09/10] Add asar to GitHub Action --- .github/workflows/notion-repackaged.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 02b1fd4..4cf3bc7 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -57,8 +57,8 @@ jobs: NOTION_REPACKAGED_REVISION: ${{ needs.preload-variables.outputs.notion_repackaged_revision }} steps: - uses: actions/checkout@v4 - - name: Install moreutils - run: sudo apt-get install -y moreutils + - name: Install moreutils and asar + run: sudo apt-get install -y moreutils asar - name: Download official Windows build env: NOTION_DOWNLOAD_HASH: ${{ needs.preload-variables.outputs.notion_download_hash }} @@ -80,8 +80,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install icnsutils and moreutils - run: sudo apt-get install -y icnsutils moreutils + - name: Install icnsutils, asar and moreutils + run: sudo apt-get install -y icnsutils moreutils asar - name: Force to use HTTPS instead of SSH run: git config --global url."https://github.com/".insteadOf "git@github.com:" - name: Retrieve saved vanilla sources From cd6658b5c8738d73536c7b07a1b27397d546e319 Mon Sep 17 00:00:00 2001 From: Maxim Therrien Date: Mon, 18 Nov 2024 01:01:41 -0500 Subject: [PATCH 10/10] Use NPM to install asar --- .github/workflows/notion-repackaged.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/notion-repackaged.yml b/.github/workflows/notion-repackaged.yml index 4cf3bc7..4009901 100644 --- a/.github/workflows/notion-repackaged.yml +++ b/.github/workflows/notion-repackaged.yml @@ -57,8 +57,10 @@ jobs: NOTION_REPACKAGED_REVISION: ${{ needs.preload-variables.outputs.notion_repackaged_revision }} steps: - uses: actions/checkout@v4 - - name: Install moreutils and asar - run: sudo apt-get install -y moreutils asar + - name: Install moreutils + run: sudo apt-get install -y moreutils + - name: Install asar + run: npm install -g asar - name: Download official Windows build env: NOTION_DOWNLOAD_HASH: ${{ needs.preload-variables.outputs.notion_download_hash }} @@ -80,8 +82,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install icnsutils, asar and moreutils - run: sudo apt-get install -y icnsutils moreutils asar + - name: Install icnsutils and moreutils + run: sudo apt-get install -y icnsutils moreutils + - name: Install asar + run: npm install -g asar - name: Force to use HTTPS instead of SSH run: git config --global url."https://github.com/".insteadOf "git@github.com:" - name: Retrieve saved vanilla sources