From aa77ca29311aa871df71490ad087b39ed2c6bfed Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Mon, 17 Nov 2025 01:50:16 +0000 Subject: [PATCH] add linux rpm packaging pipeline --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ package.json | 8 +++++++ scripts/build.js | 4 ++++ 3 files changed, 51 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3beee87d..3d4ff92d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -175,3 +175,42 @@ jobs: ;; esac done + + build-linux-rpm: + needs: prepare-release + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: npm + + - name: Install rpm packaging dependencies + run: | + sudo apt-get update + sudo apt-get install -y rpm ruby ruby-dev build-essential + sudo gem install --no-document fpm + + - name: Install project dependencies + run: npm ci + + - name: Build Linux RPM binaries + run: npm run build:linux-rpm + + - name: Upload RPM release assets + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.prepare-release.outputs.tag }} + run: | + set -euo pipefail + shopt -s nullglob + for file in release/*.rpm; do + [ -f "$file" ] || continue + gh release upload "$TAG" "$file" --clobber + done diff --git a/package.json b/package.json index d5a6c1f0..0f8808ef 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "build:win-arm64": "node scripts/build.js win-arm64", "build:linux": "node scripts/build.js linux", "build:linux-arm64": "node scripts/build.js linux-arm64", + "build:linux-rpm": "node scripts/build.js linux-rpm", "build:all": "node scripts/build.js all", "package:mac": "electron-builder --mac", "package:win": "electron-builder --win", @@ -144,6 +145,13 @@ "arm64" ] }, + { + "target": "rpm", + "arch": [ + "x64", + "arm64" + ] + }, { "target": "tar.gz", "arch": [ diff --git a/scripts/build.js b/scripts/build.js index 87741d28..7bbe23cc 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -41,6 +41,10 @@ const platforms = { args: ["--linux", "--arm64"], description: "Linux (ARM64)", }, + "linux-rpm": { + args: ["--linux", "rpm", "--x64", "--arm64"], + description: "Linux RPM packages (x64 & ARM64)", + }, all: { args: ["--mac", "--win", "--linux", "--x64", "--arm64"], description: "All platforms (macOS, Windows, Linux)",