Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 6b12374

Browse files
authored
Merge branch 'develop' into renovate/apple-actions-import-codesign-certs-5.x
2 parents 38f33d8 + 51913ec commit 6b12374

File tree

32 files changed

+529
-442
lines changed

32 files changed

+529
-442
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ npm-debug.log
3434

3535
# exceptions
3636
!/bin/copy-dist.ts
37+
!/bin/electron-forge/sign-windows.cjs
3738

3839
# temporary exception to make copy-dist inside Docker build not fail
3940
# TriliumNextTODO: make copy-dist *not* requiring to copy this file for builds other than electron-forge

.github/actions/build-electron/action.yml

Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ inputs:
88
arch:
99
description: "The architecture to build for: x64, arm64"
1010
required: true
11-
extension:
12-
description: "Platform specific extensions to copy in the output: dmg, deb, rpm, exe, zip"
11+
shell:
12+
description: "Which shell to use"
13+
required: true
14+
forge_platform:
15+
description: "The --platform to pass to Electron Forge"
1316
required: true
1417

1518
runs:
@@ -38,21 +41,21 @@ runs:
3841

3942
- name: Verify certificates
4043
if: inputs.os == 'macos'
41-
shell: bash
44+
shell: ${{ inputs.shell }}
4245
run: |
4346
echo "Available signing identities:"
4447
security find-identity -v -p codesigning build.keychain
4548
4649
- name: Set up Python and other macOS dependencies
4750
if: ${{ inputs.os == 'macos' }}
48-
shell: bash
51+
shell: ${{ inputs.shell }}
4952
run: |
5053
brew install python-setuptools
5154
brew install create-dmg
5255
5356
- name: Install dependencies for RPM and Flatpak package building
5457
if: ${{ inputs.os == 'linux' }}
55-
shell: bash
58+
shell: ${{ inputs.shell }}
5659
run: |
5760
sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils
5861
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
@@ -62,39 +65,32 @@ runs:
6265
6366
# Build setup
6467
- name: Install dependencies
65-
shell: bash
68+
shell: ${{ inputs.shell }}
6669
run: npm ci
6770

6871
- name: Update build info
69-
shell: bash
72+
shell: ${{ inputs.shell }}
7073
run: npm run chore:update-build-info
7174

7275
# Critical debugging configuration
7376
- name: Run electron-forge build with enhanced logging
74-
shell: bash
77+
shell: ${{ inputs.shell }}
7578
env:
7679
# Pass through required environment variables for signing and notarization
7780
APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }}
7881
APPLE_ID: ${{ env.APPLE_ID }}
7982
APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }}
83+
WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }}
84+
TRILIUM_ARTIFACT_NAME_HINT: TriliumNextNotes ${{ inputs.os }} ${{ inputs.arch }}
8085
run: |
81-
# Map OS names to Electron Forge platform names
82-
if [ "${{ inputs.os }}" = "macos" ]; then
83-
PLATFORM="darwin"
84-
elif [ "${{ inputs.os }}" = "windows" ]; then
85-
PLATFORM="win32"
86-
else
87-
PLATFORM="${{ inputs.os }}"
88-
fi
89-
9086
npm run electron-forge:make -- \
9187
--arch=${{ inputs.arch }} \
92-
--platform=$PLATFORM
88+
--platform=${{ inputs.forge_platform }}
9389
9490
# Add DMG signing step
9591
- name: Sign DMG
9692
if: inputs.os == 'macos'
97-
shell: bash
93+
shell: ${{ inputs.shell }}
9894
run: |
9995
echo "Signing DMG file..."
10096
dmg_file=$(find ./dist -name "*.dmg" -print -quit)
@@ -119,7 +115,7 @@ runs:
119115
120116
- name: Verify code signing
121117
if: inputs.os == 'macos'
122-
shell: bash
118+
shell: ${{ inputs.shell }}
123119
run: |
124120
echo "Verifying code signing for all artifacts..."
125121
@@ -165,49 +161,3 @@ runs:
165161
echo "Found ZIP: $zip_file"
166162
echo "Note: ZIP files are not code signed, but their contents should be"
167163
fi
168-
169-
- name: Prepare artifacts
170-
shell: bash
171-
run: |
172-
mkdir -p upload
173-
174-
if [ "${{ inputs.os }}" = "macos" ]; then
175-
# For macOS, we need to look in specific directories based on the maker
176-
echo "Collecting macOS artifacts..."
177-
178-
# Look for DMG files recursively
179-
echo "Looking for DMG files..."
180-
dmg_file=$(find ./dist -name "*.dmg" -print -quit)
181-
if [ -n "$dmg_file" ]; then
182-
echo "Found DMG: $dmg_file"
183-
cp "$dmg_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.dmg"
184-
else
185-
echo "Warning: No DMG file found"
186-
fi
187-
188-
# Look for ZIP files recursively
189-
echo "Looking for ZIP files..."
190-
zip_file=$(find ./dist -name "*.zip" -print -quit)
191-
if [ -n "$zip_file" ]; then
192-
echo "Found ZIP: $zip_file"
193-
cp "$zip_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.zip"
194-
else
195-
echo "Warning: No ZIP file found"
196-
fi
197-
else
198-
# For other platforms, use the existing logic but with better error handling
199-
echo "Collecting artifacts for ${{ inputs.os }}..."
200-
for ext in ${{ inputs.extension }}; do
201-
echo "Looking for .$ext files..."
202-
file=$(find ./dist -name "*.$ext" -print -quit)
203-
if [ -n "$file" ]; then
204-
echo "Found $file for extension $ext"
205-
cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.$ext"
206-
else
207-
echo "Warning: No file found with extension .$ext"
208-
fi
209-
done
210-
fi
211-
212-
echo "Final contents of upload directory:"
213-
ls -la upload/

.github/actions/build-server/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
- name: Set up node & dependencies
1212
uses: actions/setup-node@v4
1313
with:
14-
node-version: 20
14+
node-version: 22
1515
cache: "npm"
1616
- name: Install dependencies
1717
shell: bash

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up node & dependencies
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 20
29+
node-version: 22
3030
cache: "npm"
3131

3232
- run: npm ci

.github/workflows/main-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up node & dependencies
4646
uses: actions/setup-node@v4
4747
with:
48-
node-version: 20
48+
node-version: 22
4949
cache: "npm"
5050

5151
- name: Install npm dependencies

.github/workflows/main.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: "0 2 * * *" # run at 2 AM UTC
66
# This can be used to allow manually triggering nightlies from the web interface
77
workflow_dispatch:
8+
push:
9+
branches:
10+
- renovate/electron-forge*
811
pull_request:
912
paths:
1013
- .github/actions/build-electron/*
@@ -23,22 +26,24 @@ jobs:
2326
os:
2427
- name: macos
2528
image: macos-latest
26-
extension: [dmg, zip]
29+
shell: bash
30+
forge_platform: darwin
2731
- name: linux
2832
image: ubuntu-latest
29-
extension: [deb, rpm, zip, flatpak]
33+
shell: bash
34+
forge_platform: linux
3035
- name: windows
31-
image: windows-latest
32-
extension: [exe, zip]
36+
image: win-signing
37+
shell: cmd
38+
forge_platform: win32
3339
runs-on: ${{ matrix.os.image }}
3440
steps:
3541
- uses: actions/checkout@v4
3642
- name: Set up node & dependencies
3743
uses: actions/setup-node@v4
3844
with:
39-
node-version: 20
45+
node-version: 22
4046
- name: Install dependencies
41-
shell: bash
4247
run: npm ci
4348
- name: Update nightly version
4449
run: npm run chore:ci-update-nightly-version
@@ -47,7 +52,8 @@ jobs:
4752
with:
4853
os: ${{ matrix.os.name }}
4954
arch: ${{ matrix.arch }}
50-
extension: ${{ join(matrix.os.extension, ' ') }}
55+
shell: ${{ matrix.os.shell }}
56+
forge_platform: ${{ matrix.os.forge_platform }}
5157
env:
5258
APPLE_APP_CERTIFICATE_BASE64: ${{ secrets.APPLE_APP_CERTIFICATE_BASE64 }}
5359
APPLE_APP_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_APP_CERTIFICATE_PASSWORD }}
@@ -56,6 +62,7 @@ jobs:
5662
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
5763
APPLE_ID: ${{ secrets.APPLE_ID }}
5864
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
65+
WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }}
5966

6067
- name: Publish release
6168
uses: softprops/action-gh-release@v2
@@ -69,35 +76,9 @@ jobs:
6976
tag_name: nightly
7077
name: Nightly Build
7178

72-
nightly-server:
73-
name: Deploy server nightly
74-
strategy:
75-
fail-fast: false
76-
matrix:
77-
arch: [x64, arm64]
78-
include:
79-
- arch: x64
80-
runs-on: ubuntu-latest
81-
- arch: arm64
82-
runs-on: ubuntu-24.04-arm
83-
runs-on: ${{ matrix.runs-on }}
84-
steps:
85-
- uses: actions/checkout@v4
86-
87-
- name: Run the build
88-
uses: ./.github/actions/build-server
79+
- name: Publish artifacts
80+
uses: actions/upload-artifact@v4
81+
if: ${{ github.event_name == 'pull_request' }}
8982
with:
90-
os: linux
91-
arch: ${{ matrix.arch }}
92-
93-
- name: Publish release
94-
uses: softprops/action-gh-release@v2
95-
if: ${{ github.event_name != 'pull_request' }}
96-
with:
97-
make_latest: false
98-
prerelease: true
99-
draft: false
100-
fail_on_unmatched_files: true
101-
files: upload/*.*
102-
tag_name: nightly
103-
name: Nightly Build
83+
name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}
84+
path: upload

0 commit comments

Comments
 (0)