Skip to content

Commit f3d9008

Browse files
authored
feat(forge): rpm signing (#6646)
2 parents ec74f5f + 649a43c commit f3d9008

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,25 @@ runs:
162162
echo "Found ZIP: $zip_file"
163163
echo "Note: ZIP files are not code signed, but their contents should be"
164164
fi
165+
166+
- name: Sign the RPM
167+
if: inputs.os == 'linux'
168+
shell: ${{ inputs.shell }}
169+
run: |
170+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
171+
172+
# Import the key into RPM for verification
173+
gpg --export -a > pubkey
174+
rpm --import pubkey
175+
rm pubkey
176+
177+
# Sign the RPM
178+
rpm_file=$(find ./apps/desktop/upload -name "*.rpm" -print -quit)
179+
rpmsign --define "_gpg_name Trilium Notes Signing Key <[email protected]>" --addsign "$rpm_file"
180+
rpm -Kv "$rpm_file"
181+
182+
# Validate code signing
183+
if ! rpm -K "$rpm_file" | grep -q "digests signatures OK"; then
184+
echo .rpm file not signed
185+
exit 1
186+
fi

.github/workflows/nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
APPLE_ID: ${{ secrets.APPLE_ID }}
7777
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
7878
WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }}
79+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGN_KEY }}
7980

8081
- name: Publish release
8182
uses: softprops/[email protected]
@@ -97,7 +98,7 @@ jobs:
9798
path: apps/desktop/upload
9899

99100
nightly-server:
100-
if: github.repository == 'TriliumNext/Trilium'
101+
if: github.repository == 'TriliumNext/Trilium'
101102
name: Deploy server nightly
102103
strategy:
103104
fail-fast: false

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
APPLE_ID: ${{ secrets.APPLE_ID }}
5959
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
6060
WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }}
61+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGN_KEY }}
6162

6263
- name: Upload the artifact
6364
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)