From b6ccc06e640fec059d9b48e76a61f207ae50c695 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:43:26 +0200 Subject: [PATCH 01/24] refactor(ci): deduplicate dmg init --- .github/workflows/main.yml | 7 ++++--- .github/workflows/nightly.yml | 7 ++++--- .github/workflows/release.yml | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b20762dea..2baa62f0a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,9 +37,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f040eeecb6..a13d6e766f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,9 +34,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e12396251..95ed1e5ee8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set up Python for appdmg to be installed - if: ${{ matrix.os.name == 'macos' }} - run: brew install python-setuptools + - name: Run the build + uses: ./.github/actions/build + with: + os: ${{ matrix.os.name }} - name: Install dependencies run: npm ci - name: Update build info From 4c2824b0917266ea85999f65f1e4b8f8199719ac Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:47:09 +0200 Subject: [PATCH 02/24] refactor(ci): deduplicate installing dependencies & updating build --- .github/workflows/main.yml | 6 +----- .github/workflows/nightly.yml | 6 +----- .github/workflows/release.yml | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2baa62f0a9..781845df60 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,11 +40,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Run electron-forge run: npm run make-electron -- --arch=${{ matrix.arch }} - name: Prepare artifacts (Unix) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a13d6e766f..4f43a123af 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -37,11 +37,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Update nightly version run: npm run ci-update-nightly-version - name: Run electron-forge diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95ed1e5ee8..37d5ad4d94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,11 +37,7 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Install dependencies - run: npm ci - - name: Update build info - run: npm run update-build-info + os: ${{ matrix.os.name }} - name: Run electron-forge run: npm run make-electron -- --arch=${{ matrix.arch }} - name: Prepare artifacts (Unix) From fb762afa284e42551fc068bdf5758604c375cc52 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:49:50 +0200 Subject: [PATCH 03/24] refactor(ci): deduplicate electron-forge --- .github/workflows/main.yml | 5 ++--- .github/workflows/nightly.yml | 7 +++---- .github/workflows/release.yml | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 781845df60..362f3d1b41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,13 +36,12 @@ jobs: - name: Set up node & dependencies uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 20 - name: Run the build uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4f43a123af..f291e5c9d5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -34,14 +34,13 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + - name: Update nightly version + run: npm run ci-update-nightly-version - name: Run the build uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - - name: Update nightly version - run: npm run ci-update-nightly-version - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37d5ad4d94..223989d91c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,9 +37,8 @@ jobs: - name: Run the build uses: ./.github/actions/build with: - os: ${{ matrix.os.name }} - - name: Run electron-forge - run: npm run make-electron -- --arch=${{ matrix.arch }} + os: ${{ matrix.os.name }} + arch: ${{ matrix.arch }} - name: Prepare artifacts (Unix) if: runner.os != 'windows' run: | From b16bce106251f3a29a4fb91cf924973fd6546fa3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:55:46 +0200 Subject: [PATCH 04/24] refactor(ci): deduplicate preparing artifacts --- .github/workflows/main.yml | 17 +---------------- .github/workflows/nightly.yml | 17 +---------------- .github/workflows/release.yml | 19 ++----------------- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 362f3d1b41..8610346aad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,22 +42,7 @@ jobs: with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f291e5c9d5..0c2027ed75 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,22 +41,7 @@ jobs: with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 223989d91c..06d4cef9d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,23 +38,8 @@ jobs: uses: ./.github/actions/build with: os: ${{ matrix.os.name }} - arch: ${{ matrix.arch }} - - name: Prepare artifacts (Unix) - if: runner.os != 'windows' - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: runner.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ matrix.os.name }}-${{ matrix.arch }}.${{ matrix.os.extension }}" + arch: ${{ matrix.arch }} + extension: ${{ matrix.os.extension }} - name: Publish release uses: softprops/action-gh-release@v2 with: From 102b0528737aaee47063630ea875c4daf2ff2b23 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 20:58:54 +0200 Subject: [PATCH 05/24] chore(ci): test dev build on signing runner --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8610346aad..378bbade7a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: branches: - "feature/update**" - "feature/server_esm**" + - "feature/windows_signing" paths-ignore: - "docs/**" - ".github/workflows/main-docker.yml" @@ -28,7 +29,7 @@ jobs: image: ubuntu-latest extension: deb - name: windows - image: windows-latest + image: win-signing extension: exe runs-on: ${{ matrix.os.image }} steps: From 631c60e9dcdc9f5cabbea95f8a2d7ceb6a7cc035 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 21:02:27 +0200 Subject: [PATCH 06/24] fix(ci): add missing file --- .github/actions/build-electron/action.yml | 38 +++++++++++++++++++++++ .github/workflows/main.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .github/actions/build-electron/action.yml diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml new file mode 100644 index 0000000000..007082a836 --- /dev/null +++ b/.github/actions/build-electron/action.yml @@ -0,0 +1,38 @@ +inputs: + os: + description: "One of the supported platforms: macos, linux, windows" + required: true + arch: + description: "The architecture to build for: x64, arm64" + required: true + extension: + description: "Platform specific extension to build: dmg, deb, exe" + required: true +runs: + using: composite + steps: + - name: Set up Python for appdmg to be installed + if: ${{ inputs.os == 'macos' }} + run: brew install python-setuptools + - name: Install dependencies + run: npm ci + - name: Update build info + run: npm run update-build-info + - name: Run electron-forge + run: npm run make-electron -- --arch=${{ inputs.arch }} + - name: Prepare artifacts (Unix) + if: inputs.os != 'windows' + run: | + mkdir -p upload + file=$(find out/make -name '*.zip' -print -quit) + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" + file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" + - name: Prepare artifacts (Windows) + if: inputs.os == 'windows' + run: | + mkdir upload + $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 + Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" + $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 + Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 378bbade7a..72b36adaed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,7 @@ jobs: with: node-version: 20 - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0c2027ed75..4de586be7e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -37,7 +37,7 @@ jobs: - name: Update nightly version run: npm run ci-update-nightly-version - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06d4cef9d8..fb62c3a6b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: with: node-version: 20 - name: Run the build - uses: ./.github/actions/build + uses: ./.github/actions/build-electron with: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} From 7baa9450c67ec478cfb8c6ce7934bf3fe07416e8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 21:09:04 +0200 Subject: [PATCH 07/24] fix(ci): required shell --- .github/actions/build-electron/action.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 007082a836..f9dd2ffa57 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -13,26 +13,22 @@ runs: steps: - name: Set up Python for appdmg to be installed if: ${{ inputs.os == 'macos' }} + shell: bash run: brew install python-setuptools - name: Install dependencies + shell: bash run: npm ci - name: Update build info + shell: bash run: npm run update-build-info - name: Run electron-forge + shell: bash run: npm run make-electron -- --arch=${{ inputs.arch }} - - name: Prepare artifacts (Unix) - if: inputs.os != 'windows' + - name: Prepare artifacts + shell: bash run: | mkdir -p upload file=$(find out/make -name '*.zip' -print -quit) cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" - - name: Prepare artifacts (Windows) - if: inputs.os == 'windows' - run: | - mkdir upload - $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" - $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 - Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file + cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file From 9b866e1c83b5972398f67327ae9907cfc2f77baa Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 18 Jan 2025 21:13:37 +0200 Subject: [PATCH 08/24] fix(ci): stop running on dedicated runner --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72b36adaed..ff7e883929 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: image: ubuntu-latest extension: deb - name: windows - image: win-signing + image: windows-latest extension: exe runs-on: ${{ matrix.os.image }} steps: From b477d5b01f0c547085c884c48ce9043ba8d49a80 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:23:34 +0200 Subject: [PATCH 09/24] feat(ci): upload build result as artifact --- .github/actions/build-electron/action.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index f9dd2ffa57..8a3b4627c9 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -24,11 +24,7 @@ runs: - name: Run electron-forge shell: bash run: npm run make-electron -- --arch=${{ inputs.arch }} - - name: Prepare artifacts - shell: bash - run: | - mkdir -p upload - file=$(find out/make -name '*.zip' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.zip" - file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.${{ matrix.os.extension }}" \ No newline at end of file + - uses: actions/upload-artifact@v4 + with: + name: Artifacts + path: out/make From 3a89cb15ac34403c7ef572f50bd8d2aef3f1c9a8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:24:03 +0200 Subject: [PATCH 10/24] chore(ci): keep only windows signing for now --- .github/workflows/main.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff7e883929..f9088fc9b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: paths-ignore: - "docs/**" - ".github/workflows/main-docker.yml" - workflow_dispatch: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -20,14 +20,8 @@ jobs: strategy: fail-fast: false matrix: - arch: [x64, arm64] + arch: [x64] os: - - name: macos - image: macos-latest - extension: dmg - - name: linux - image: ubuntu-latest - extension: deb - name: windows image: windows-latest extension: exe @@ -37,13 +31,13 @@ jobs: - name: Set up node & dependencies uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 20 - name: Run the build uses: ./.github/actions/build-electron with: - os: ${{ matrix.os.name }} + os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} - extension: ${{ matrix.os.extension }} + extension: ${{ matrix.os.extension }} - name: Publish artifacts uses: actions/upload-artifact@v4 with: From 1d2054ef05da314c50befcec077c433e000b3e85 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:36:47 +0200 Subject: [PATCH 11/24] chore(ci): remove server build for now --- .github/workflows/main.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9088fc9b7..5a1d0c86f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,39 +48,3 @@ jobs: with: name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.${{matrix.os.extension}} path: upload/*.${{ matrix.os.extension }} - build_linux_server: - name: Build Linux Server - strategy: - fail-fast: false - matrix: - arch: [x64, arm64] - include: - - arch: x64 - runs-on: ubuntu-latest - - arch: arm64 - runs-on: ubuntu-24.04-arm - runs-on: ${{ matrix.runs-on }} - steps: - - uses: actions/checkout@v4 - - name: Set up node & dependencies - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "npm" - - name: Install dependencies - run: npm ci - - name: Run Linux server build - env: - MATRIX_ARCH: ${{ matrix.arch }} - run: | - npm run update-build-info - ./bin/build-server.sh - - name: Prepare artifacts - run: | - mkdir -p upload - file=$(find dist -name '*.tar.xz' -print -quit) - cp "$file" "upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz" - - uses: actions/upload-artifact@v4 - with: - name: TriliumNextNotes linux server ${{ matrix.arch }} - path: upload/TriliumNextNotes-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.xz From fceaf233330a2d8fff7d43d5e9d0518aaa77d312 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:48:40 +0200 Subject: [PATCH 12/24] feat(ci): add job for signing --- .github/workflows/main.yml | 18 ++++++++++++++++++ package-lock.json | 1 + package.json | 1 + 3 files changed, 20 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a1d0c86f1..c08bd13566 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,3 +48,21 @@ jobs: with: name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.${{matrix.os.extension}} path: upload/*.${{ matrix.os.extension }} + sign-windows: + name: Sign Windows build + runs-on: win-signing + needs: + - make-electron + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: Artifacts + path: ./sign + - run: find sign + - run: npx electron-windows-sign + env: + WINDOWS_SIGNTOOL_PATH: "C:\\ev_signer_trilium\\ev_signer_trilium.exe" + WINDOWS_SIGN_WITH_PARAMS: "--executable" + diff --git a/package-lock.json b/package-lock.json index f441eb0d3d..6d0ea4ebbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -111,6 +111,7 @@ "@electron-forge/maker-zip": "7.6.0", "@electron-forge/plugin-auto-unpack-natives": "7.6.0", "@electron/rebuild": "3.7.1", + "@electron/windows-sign": "1.2.0", "@playwright/test": "1.49.1", "@types/archiver": "6.0.3", "@types/better-sqlite3": "7.6.12", diff --git a/package.json b/package.json index 0443438790..ad07510ccf 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "@electron-forge/maker-zip": "7.6.0", "@electron-forge/plugin-auto-unpack-natives": "7.6.0", "@electron/rebuild": "3.7.1", + "@electron/windows-sign": "1.2.0", "@playwright/test": "1.49.1", "@types/archiver": "6.0.3", "@types/better-sqlite3": "7.6.12", From dc88ec06d33c05af8ec12774803bec8058dfd007 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 00:49:06 +0200 Subject: [PATCH 13/24] chore(editorconfig): add config for yaml files --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.editorconfig b/.editorconfig index 2ec3ed9fa0..c0aba9b74d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,3 +15,9 @@ indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true + +[*.yml] +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file From 5c9caa12d113b3e7ff6542298b6ebb32543a9b8d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 10:11:49 +0200 Subject: [PATCH 14/24] fix(ci): remove find job --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c08bd13566..b5dcd14ca8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,7 +60,6 @@ jobs: with: name: Artifacts path: ./sign - - run: find sign - run: npx electron-windows-sign env: WINDOWS_SIGNTOOL_PATH: "C:\\ev_signer_trilium\\ev_signer_trilium.exe" From ffe73fe78393661137a2d7ce510386f11993da0c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 10:49:18 +0200 Subject: [PATCH 15/24] chore(ci): run build on windows signing (again) --- .github/workflows/main.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5dcd14ca8..cca795299e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: arch: [x64] os: - name: windows - image: windows-latest + image: win-signing extension: exe runs-on: ${{ matrix.os.image }} steps: @@ -48,20 +48,3 @@ jobs: with: name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.${{matrix.os.extension}} path: upload/*.${{ matrix.os.extension }} - sign-windows: - name: Sign Windows build - runs-on: win-signing - needs: - - make-electron - steps: - - uses: actions/checkout@v4 - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: Artifacts - path: ./sign - - run: npx electron-windows-sign - env: - WINDOWS_SIGNTOOL_PATH: "C:\\ev_signer_trilium\\ev_signer_trilium.exe" - WINDOWS_SIGN_WITH_PARAMS: "--executable" - From eaf7e2677f2482ada3b58f6c9e4569e4e19876ff Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 10:56:16 +0200 Subject: [PATCH 16/24] chore(ci): use cmd instead of bash --- .github/actions/build-electron/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 8a3b4627c9..cf3a696288 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -16,13 +16,13 @@ runs: shell: bash run: brew install python-setuptools - name: Install dependencies - shell: bash + shell: cmd run: npm ci - name: Update build info - shell: bash + shell: cmd run: npm run update-build-info - name: Run electron-forge - shell: bash + shell: cmd run: npm run make-electron -- --arch=${{ inputs.arch }} - uses: actions/upload-artifact@v4 with: From 16e091c3236d5f709b407a4b0ace67e2ed218c14 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 11:03:47 +0200 Subject: [PATCH 17/24] chore(ci): disable build info for now --- .github/actions/build-electron/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index cf3a696288..148c3515af 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -20,6 +20,7 @@ runs: run: npm ci - name: Update build info shell: cmd + if: false run: npm run update-build-info - name: Run electron-forge shell: cmd From 25a8b779b7818533c2427f1979fe78feb3ddf823 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 11:36:45 +0200 Subject: [PATCH 18/24] feat(ci): try calling windows signing hook --- bin/sign-windows.js | 3 +++ forge.config.cjs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 bin/sign-windows.js diff --git a/bin/sign-windows.js b/bin/sign-windows.js new file mode 100644 index 0000000000..56308a83b6 --- /dev/null +++ b/bin/sign-windows.js @@ -0,0 +1,3 @@ +export default async function (filePath) { + console.log(`Path to file to sign: ${filePath}`) +} diff --git a/forge.config.cjs b/forge.config.cjs index 64ef74b165..8687adb2da 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -63,7 +63,10 @@ module.exports = { config: { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/icon.ico", - loadingGif: "./images/app-icons/win/setup-banner.gif" + loadingGif: "./images/app-icons/win/setup-banner.gif", + windowsSign: { + hookModulePath: "./bin/sign-windows.js" + } } }, { From 2a4cc4193920c002c93ca9720654aec4912269d5 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 11:57:05 +0200 Subject: [PATCH 19/24] chore(ci): using signing params instead of hook --- .github/actions/build-electron/action.yml | 3 +++ .github/workflows/main.yml | 3 +++ forge.config.cjs | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 148c3515af..cd533d83ce 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -25,6 +25,9 @@ runs: - name: Run electron-forge shell: cmd run: npm run make-electron -- --arch=${{ inputs.arch }} + env: + WINDOWS_SIGNTOOL_PATH: "C:\\ev_signer_trilium\\ev_signer_trilium.exe" + WINDOWS_SIGN_WITH_PARAMS: --executable - uses: actions/upload-artifact@v4 with: name: Artifacts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cca795299e..2aad22d6e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,9 @@ jobs: os: ${{ matrix.os.name }} arch: ${{ matrix.arch }} extension: ${{ matrix.os.extension }} + env: + WINDOWS_SIGNTOOL_PATH: "C:\\ev_signer_trilium\\ev_signer_trilium.exe" + WINDOWS_SIGN_WITH_PARAMS: --executable - name: Publish artifacts uses: actions/upload-artifact@v4 with: diff --git a/forge.config.cjs b/forge.config.cjs index 8687adb2da..d38284bb80 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -1,6 +1,5 @@ const path = require("path"); const fs = require("fs-extra"); - const APP_NAME = "TriliumNext Notes"; module.exports = { @@ -10,6 +9,14 @@ module.exports = { overwrite: true, asar: true, icon: "./images/app-icons/icon", + signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", + signWithParams: "--executable", + windowsSign: { + signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", + signWithParams: [ + "--executable" + ] + }, extraResource: [ // Moved to root ...getExtraResourcesForPlatform(), @@ -65,7 +72,10 @@ module.exports = { setupIcon: "./images/app-icons/icon.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", windowsSign: { - hookModulePath: "./bin/sign-windows.js" + signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", + signWithParams: [ + "--executable" + ] } } }, From cca3fc61e8ffcefe0ca0b98418dcc746a5ff5d9c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 18:51:19 +0200 Subject: [PATCH 20/24] chore(ci): try again with a hook --- forge.config.cjs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index d38284bb80..a423554cb2 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -12,10 +12,7 @@ module.exports = { signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", signWithParams: "--executable", windowsSign: { - signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", - signWithParams: [ - "--executable" - ] + hookModulePath: "bin\\sign-windows.js" }, extraResource: [ // Moved to root @@ -72,10 +69,7 @@ module.exports = { setupIcon: "./images/app-icons/icon.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", windowsSign: { - signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", - signWithParams: [ - "--executable" - ] + hookModulePath: "bin\\sign-windows.js" } } }, From 4c529afd93e6669b66e8964ec921e3b5f75c02a3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 19:25:59 +0200 Subject: [PATCH 21/24] feat(ci): adapt hook script to call executable --- bin/sign-windows.js | 8 ++++++-- forge.config.cjs | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/sign-windows.js b/bin/sign-windows.js index 56308a83b6..ba8fa1a2aa 100644 --- a/bin/sign-windows.js +++ b/bin/sign-windows.js @@ -1,3 +1,7 @@ -export default async function (filePath) { - console.log(`Path to file to sign: ${filePath}`) +const child_process = require("child_process"); +const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; + +module.exports = function (filePath) { + console.log(`Path to file to sign: ${filePath}`); + child_process.execSync(`${SIGN_EXECUTABLE} "${filePath}"`); } diff --git a/forge.config.cjs b/forge.config.cjs index a423554cb2..199e3d85b3 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -9,8 +9,6 @@ module.exports = { overwrite: true, asar: true, icon: "./images/app-icons/icon", - signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", - signWithParams: "--executable", windowsSign: { hookModulePath: "bin\\sign-windows.js" }, From e7152d1a818380b1fc7724ab452962d489c6d7a2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 19:42:57 +0200 Subject: [PATCH 22/24] fix(ci): use cjs for signing script --- bin/{sign-windows.js => sign-windows.cjs} | 0 forge.config.cjs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename bin/{sign-windows.js => sign-windows.cjs} (100%) diff --git a/bin/sign-windows.js b/bin/sign-windows.cjs similarity index 100% rename from bin/sign-windows.js rename to bin/sign-windows.cjs diff --git a/forge.config.cjs b/forge.config.cjs index 199e3d85b3..5f08f21f78 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -10,7 +10,7 @@ module.exports = { asar: true, icon: "./images/app-icons/icon", windowsSign: { - hookModulePath: "bin\\sign-windows.js" + hookModulePath: "bin\\sign-windows.cjs" }, extraResource: [ // Moved to root From f8bbbbd8e43e5fb4574c4666bd39138acdbf84fe Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 20:04:35 +0200 Subject: [PATCH 23/24] fix(ci): use right command --- bin/sign-windows.cjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/sign-windows.cjs b/bin/sign-windows.cjs index ba8fa1a2aa..146ee9b443 100644 --- a/bin/sign-windows.cjs +++ b/bin/sign-windows.cjs @@ -2,6 +2,7 @@ const child_process = require("child_process"); const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; module.exports = function (filePath) { - console.log(`Path to file to sign: ${filePath}`); - child_process.execSync(`${SIGN_EXECUTABLE} "${filePath}"`); + const command = `${SIGN_EXECUTABLE} --executable "${filePath}"`; + console.log(`> ${command}`); + child_process.execSync(command); } From 8b19548594551076a023f1731c090e2dd299c25e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Jan 2025 23:03:48 +0200 Subject: [PATCH 24/24] chore(ci): don't sign squirrel build --- forge.config.cjs | 3 --- 1 file changed, 3 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index 5f08f21f78..04406cbb25 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -66,9 +66,6 @@ module.exports = { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/icon.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", - windowsSign: { - hookModulePath: "bin\\sign-windows.js" - } } }, {