fix rpm packaging

This commit is contained in:
Julian Chang 2026-07-24 09:23:09 +09:00
parent bd685784f8
commit b20b005283
No known key found for this signature in database
3 changed files with 32 additions and 7 deletions

View file

@ -32,7 +32,7 @@ jobs:
target: ''
os_key: linux
arch: x86_64
formats: deb,rpm,appimage
formats: deb,appimage
- platform: windows-latest
target: ''
os_key: windows
@ -95,6 +95,15 @@ jobs:
echo "dir=target/release" >> "$GITHUB_OUTPUT"
fi
- name: (Linux) Build RPM
if: matrix.platform == 'ubuntu-22.04'
shell: bash
run: |
set -euo pipefail
cargo install cargo-generate-rpm --version 0.21.0 --locked
cargo generate-rpm -p oneclient_app
cp target/generate-rpm/*.rpm "${{ steps.outdir.outputs.dir }}/"
# Upload debug info (dSYM / .dwp / .pdb produced by the release profile's
# split-debuginfo) to Sentry so nightly crash reports get real file/function/
# line stack traces instead of raw addresses. Runs on every main push, so

View file

@ -65,7 +65,7 @@ jobs:
target: ''
os_key: linux
arch: x86_64
formats: deb,rpm,appimage
formats: deb,appimage
- platform: windows-latest
target: ''
os_key: windows
@ -167,6 +167,15 @@ jobs:
echo "dir=target/release" >> "$GITHUB_OUTPUT"
fi
- name: (Linux) Build RPM
if: matrix.platform == 'ubuntu-22.04'
shell: bash
run: |
set -euo pipefail
cargo install cargo-generate-rpm --version 0.21.0 --locked
cargo generate-rpm -p oneclient_app
cp target/generate-rpm/*.rpm "${{ steps.outdir.outputs.dir }}/"
# Upload debug info (dSYM / .dwp / .pdb produced by the release profile's
# split-debuginfo) to Sentry so crash reports get real file/function/line
# stack traces instead of raw addresses. Skips silently unless the repo has
@ -273,7 +282,7 @@ jobs:
cp "${deb_matches[0]}" "$OUT_DIR/$deb_unique"
fi
# Same treatment for the .rpm (cargo-packager names it
# Same treatment for the .rpm (cargo-generate-rpm names it
# oneclient_app-<ver>-1.x86_64.rpm).
rpm_unique=""
rpm_matches=("$OUT_DIR"/*.rpm)

View file

@ -58,7 +58,7 @@ publisher = "Polyfrost"
copyright = "© 2026 Polyfrost Inc."
homepage = "https://polyfrost.org/projects/oneclient"
long-description = "Next-generation open source Minecraft launcher"
formats = ["nsis", "app", "dmg", "deb", "rpm", "appimage"]
formats = ["nsis", "app", "dmg", "deb", "appimage"]
binaries = [{ path = "oneclient_app", main = true }]
icons = [
"icons/32x32.png",
@ -122,9 +122,16 @@ SectionEnd
[package.metadata.packager.deb]
desktop-template = "distribution/linux/org.polyfrost.oneclient.template"
[package.metadata.packager.rpm]
desktop-template = "distribution/linux/org.polyfrost.oneclient.template"
[package.metadata.packager.appimage]
# desktop entry generated from the deb template above via the linux config
[package.metadata.generate-rpm]
auto-req = "builtin"
assets = [
{ source = "target/release/oneclient_app", dest = "/usr/bin/oneclient_app", mode = "755" },
{ source = "target/release/.cargo-packager/deb/*/data/usr/share/applications/oneclient_app.desktop", dest = "/usr/share/applications/", mode = "644" },
{ source = "icons/32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/oneclient_app.png", mode = "644" },
{ source = "icons/128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/oneclient_app.png", mode = "644" },
{ source = "icons/512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/oneclient_app.png", mode = "644" },
]