From 15f8d83c8d6ef2e8c3955e3f20da930419878d57 Mon Sep 17 00:00:00 2001 From: silentrald Date: Sat, 9 Nov 2024 12:02:00 +0800 Subject: [PATCH] [chore-627] drop rpm and pacman in favor of flatpak --- .github/workflows/build.yaml | 2 +- .github/workflows/release-linux.yaml | 19 +++++++++++++++---- docs/wiki/Linux.md | 28 +++++++++++++++++++--------- electron-builder.ts | 8 -------- package.json | 2 +- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ab5d0f71..f0b44b08 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,7 +22,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 22.11.0 cache: "npm" - run: npm ci - run: npm run package diff --git a/.github/workflows/release-linux.yaml b/.github/workflows/release-linux.yaml index 45d33c36..6785ad42 100644 --- a/.github/workflows/release-linux.yaml +++ b/.github/workflows/release-linux.yaml @@ -20,16 +20,27 @@ jobs: - name: Check out Git repository uses: actions/checkout@v4 - - name: Install dependencies for rpm and pacman - run: sudo apt-get install -y rpm libarchive-tools + - name: Install flatpak packages + run: sudo apt-get install -y flatpak flatpak-builder + + - name: Setup flatpak repo + run: | + flatpak remote-add --if-not-exists --user \ + flathub https://flathub.org/repo/flathub.flatpakrepo - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 22.11.0 cache: "npm" - run: npm ci - - run: npm run publish:linux + - run: npm run build + + - name: Build deb + run: npx electron-builder --publish always --linux deb --x64 + + - name: Build flatpak + run: env DEBUG="@malept/flatpak-bundler" npx electron-builder --publish always --linux flatpak - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/docs/wiki/Linux.md b/docs/wiki/Linux.md index 046d0e42..31eda4f8 100644 --- a/docs/wiki/Linux.md +++ b/docs/wiki/Linux.md @@ -4,27 +4,37 @@ Go to [Releases](https://github.com/Zagrios/bs-manager/releases) page and go to the latest release. Download the necessary build installer for your distro (see below). -### Ubuntu, Debian +### Universal (flatpak) + +You are required to have `flatpak` installed your system. After installing that, download the `.flatpak` file in the releases and run the following command: -Install the `.deb` build and run the following command: ```bash -apt install bsmanager.deb +flatpak install ./bsmanager.flatpak ``` -### CentOS, Fedora +If you are getting errors like packages not existing, run this command so that it finds the correct packages. -Install the `.rpm` build and run the following command: ```bash -rpm -i bsmanager.rpm +sudo flatpak remote-add --if-not-exists --system flathub https://flathub.org/repo/flathub.flatpakrepo + +# or + +flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo ``` -### Arch, Manjaro +### Ubuntu, Debian (deb) -Install the `.pacman` build and run the following command: +Download the `.deb` file in the releases and run the following command: ```bash -pacman -U bsmanager.pacman +dpkg -i ./bsmanager.deb ``` +### Arch (AUR) + +Refer to [bs-manager-git](https://aur.archlinux.org/packages/bs-manager-git). + +To install AUR packages, you need to install [yay](https://github.com/Jguer/yay). + ## Proton Setup [Proton](https://github.com/ValveSoftware/Proton) is needed to run the Beat Saber executable under Linux. You need to download this from either from Steam or building it from their GitHub repo. diff --git a/electron-builder.ts b/electron-builder.ts index 3e65f3cd..2ed49fd5 100644 --- a/electron-builder.ts +++ b/electron-builder.ts @@ -32,8 +32,6 @@ const config: Configuration = { linux: { target: [ "deb", - "rpm", - "pacman" ], icon: "./build/icons/png", category: "Utility;Game;", @@ -55,12 +53,6 @@ const config: Configuration = { deb: { fpm: ["--after-install=build/after-install.sh"], }, - rpm: { - fpm: ["--after-install=build/after-install.sh"], - }, - pacman: { - fpm: ["--after-install=build/after-install.sh"], - }, directories: { app: "release/app", buildResources: "assets", diff --git a/package.json b/package.json index 39b081a9..8cbba4f4 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "test": "jest", "test:unit": "jest ./src/__tests__/unit", "publish": "npm run build && electron-builder --publish always --win --x64", - "publish:linux": "npm run build && electron-builder --publish always --linux --x64" + "publish:linux": "npm run build && electron-builder --publish never --linux --x64" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [