diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 93772d7d9..add8f3156 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -162,3 +162,25 @@ runs: echo "Found ZIP: $zip_file" echo "Note: ZIP files are not code signed, but their contents should be" fi + + - name: Sign the RPM + if: inputs.os == 'linux' + shell: ${{ inputs.shell }} + run: | + echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import + + # Import the key into RPM for verification + gpg --export -a > pubkey + rpm --import pubkey + rm pubkey + + # Sign the RPM + rpm_file=$(find ./apps/desktop/upload -name "*.rpm" -print -quit) + rpmsign --define "_gpg_name Trilium Notes Signing Key " --addsign "$rpm_file" + rpm -Kv "$rpm_file" + + # Validate code signing + if ! rpm -K "$rpm_file" | grep -q "digests signatures OK"; then + echo .rpm file not signed + exit 1 + fi diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cfed9c4fe..03a9b5262 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -76,6 +76,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }} + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGN_KEY }} - name: Publish release uses: softprops/action-gh-release@v2.3.2 @@ -97,7 +98,7 @@ jobs: path: apps/desktop/upload nightly-server: - if: github.repository == 'TriliumNext/Trilium' + if: github.repository == 'TriliumNext/Trilium' name: Deploy server nightly strategy: fail-fast: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 041e7a437..20161630f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,6 +58,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }} + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGN_KEY }} - name: Upload the artifact uses: actions/upload-artifact@v4