diff --git a/.github/workflows/new_tag_release.yaml b/.github/workflows/new_tag_release.yaml index 9a885bbe6..a98d605fd 100644 --- a/.github/workflows/new_tag_release.yaml +++ b/.github/workflows/new_tag_release.yaml @@ -282,9 +282,11 @@ jobs: include: - runner: ubuntu-latest arch: x86_64 + deb-arch: amd64 rust-target: x86_64-unknown-linux-gnu - runner: ubuntu-24.04-arm arch: aarch64 + deb-arch: arm64 rust-target: aarch64-unknown-linux-gnu steps: - name: "Checkout" @@ -326,6 +328,7 @@ jobs: run: >- ./gradlew :desktopApp:packageReleaseDistributable + :desktopApp:packageReleaseDeb -Pkeyguard.nativeCrypto.cargoOffline=true - name: 'Upload .tar' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a @@ -333,6 +336,75 @@ jobs: name: app-linux-${{ matrix.arch }} path: | desktopApp/build/distributions/*.tar.gz + - name: "Add a suffix to the .deb artifacts" + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + packages=(desktopApp/build/compose/binaries/main-release/deb/*.deb) + test "${#packages[@]}" -eq 1 + package="${packages[0]}" + mv -- "$package" "${package%.deb}-${{ matrix.arch }}.deb" + - name: "Verify .deb" + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + packages=(desktopApp/build/compose/binaries/main-release/deb/*.deb) + test "${#packages[@]}" -eq 1 + package="${packages[0]}" + test "$(dpkg-deb --field "$package" Architecture)" = "${{ matrix.deb-arch }}" + case "$(dpkg-deb --field "$package" Version)" in + "${{ needs.generate-versions.outputs.version-semantic }}"*) ;; + *) exit 1 ;; + esac + dpkg-deb --info "$package" + dpkg-deb --contents "$package" + - name: 'Upload .deb' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a + with: + name: app-linux-deb-${{ matrix.arch }} + path: desktopApp/build/compose/binaries/main-release/deb/*.deb + retention-days: 1 + if-no-files-found: error + - name: "Ensure rpmbuild is available" + run: | + if ! command -v rpmbuild >/dev/null; then + sudo apt-get update + sudo apt-get install -y rpm + fi + - name: "Package .rpm" + run: | + set -euo pipefail + SOURCES="$PWD/rpmbuild/SOURCES" + mkdir -p "$SOURCES" + cp desktopApp/build/distributions/*.tar.gz "$SOURCES/keyguard-${{ needs.generate-versions.outputs.version-semantic }}.tar.gz" + rpmbuild -ba desktopApp/rpm/keyguard.spec \ + --define "_app_version ${{ needs.generate-versions.outputs.version-semantic }}" \ + --define "_topdir $PWD/rpmbuild" \ + --define "_sourcedir $SOURCES" + - name: "Verify .rpm" + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + packages=(rpmbuild/RPMS/${{ matrix.arch }}/*.rpm) + test "${#packages[@]}" -eq 1 + package="${packages[0]}" + test "$(rpm -qp --queryformat '%{ARCH}' "$package")" = "${{ matrix.arch }}" + test "$(rpm -qp --queryformat '%{VERSION}' "$package")" = "${{ needs.generate-versions.outputs.version-semantic }}" + rpm -qip "$package" + rpm -qp --requires "$package" | grep -Fx '/usr/bin/xdg-open' + rpm -qlp "$package" + rpm -qlp "$package" | grep -Fx '/usr/bin/keyguard' + rpm -qlp "$package" | grep -Fx '/usr/share/applications/com.artemchep.keyguard.desktop' + - name: 'Upload .rpm' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a + with: + name: app-linux-rpm-${{ matrix.arch }} + path: rpmbuild/RPMS/${{ matrix.arch }}/*.rpm + retention-days: 1 + if-no-files-found: error - name: "Move binaries into the template directory" run: | mkdir -p desktopApp/flatpak/app-${{ matrix.arch }}/ @@ -699,6 +771,26 @@ jobs: with: name: app-linux-flatpak-aarch64 path: artifacts + - name: "Download Linux .deb (x86_64)" + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: app-linux-deb-x86_64 + path: artifacts + - name: "Download Linux .deb (aarch64)" + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: app-linux-deb-aarch64 + path: artifacts + - name: "Download Linux .rpm (x86_64)" + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: app-linux-rpm-x86_64 + path: artifacts + - name: "Download Linux .rpm (aarch64)" + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: app-linux-rpm-aarch64 + path: artifacts - name: "Download Windows app" uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c with: diff --git a/README.md b/README.md index 26f16f654..c65aadeff 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ You can find the `.apk` binary on the [releases page](https://github.com/AChep/k - [F-Droid custom repo](https://gh.artemchep.com/keyguard-repo-fdroid/repo). ### Linux -You can find the `.flatpak` binary on the [releases page](https://github.com/AChep/keyguard-app/releases/latest). +You can find the `.flatpak`, `.deb`, and `.rpm` packages on the [releases page](https://github.com/AChep/keyguard-app/releases/latest). - [Flathub](https://flathub.org/apps/com.artemchep.keyguard). ##### [AUR](https://aur.archlinux.org/) Keyguard [package](https://aur.archlinux.org/packages/keyguard-bin) diff --git a/desktopApp/rpm/keyguard.spec b/desktopApp/rpm/keyguard.spec new file mode 100644 index 000000000..cfbe82ca0 --- /dev/null +++ b/desktopApp/rpm/keyguard.spec @@ -0,0 +1,48 @@ +Name: keyguard +Version: %{_app_version} +Release: 1%{?dist} +Summary: Password manager +License: Proprietary +URL: https://github.com/AChep/keyguard-app +Source0: %{name}-%{version}.tar.gz +Requires: /usr/bin/xdg-open + +%description +Keyguard is a cross-platform password manager that supports Bitwarden +and KeePass databases. + +%prep +%setup -q -n Keyguard + +%install +mkdir -p %{buildroot}/opt/%{name} +cp -a * %{buildroot}/opt/%{name}/ + +# The launcher may arrive with a normalized non-executable mode +# because Gradle's Tar task does not preserve file permissions. +chmod +x %{buildroot}/opt/%{name}/bin/Keyguard + +mkdir -p %{buildroot}/usr/bin +ln -sf /opt/%{name}/bin/Keyguard %{buildroot}/usr/bin/%{name} + +install -Dm0644 \ + share/applications/com.artemchep.keyguard.desktop \ + %{buildroot}%{_datadir}/applications/com.artemchep.keyguard.desktop +sed -i 's/^Exec=Keyguard$/Exec=keyguard/' \ + %{buildroot}%{_datadir}/applications/com.artemchep.keyguard.desktop + +install -Dm0644 \ + share/icons/hicolor/scalable/apps/com.artemchep.keyguard.svg \ + %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/com.artemchep.keyguard.svg +install -Dm0644 \ + share/metainfo/com.artemchep.keyguard.metainfo.xml \ + %{buildroot}%{_datadir}/metainfo/com.artemchep.keyguard.metainfo.xml + +%files +/opt/%{name}/ +/usr/bin/%{name} +%{_datadir}/applications/com.artemchep.keyguard.desktop +%{_datadir}/icons/hicolor/scalable/apps/com.artemchep.keyguard.svg +%{_datadir}/metainfo/com.artemchep.keyguard.metainfo.xml + +%changelog diff --git a/server/web/src/consts.ts b/server/web/src/consts.ts index 7de08f023..e23aa7d92 100644 --- a/server/web/src/consts.ts +++ b/server/web/src/consts.ts @@ -68,12 +68,12 @@ export const PLATFORMS: DownloadPlatform[] = [ }, { name: 'Linux', - note: 'Flatpak & Arch', + note: 'Flatpak, DEB, RPM & Arch', stores: [ { label: 'Flathub', href: 'https://flathub.org/apps/com.artemchep.keyguard' }, ], commands: [{ label: 'Arch Linux (AUR)', code: 'yay -S keyguard-bin' }], - direct: { label: 'Flatpak', href: RELEASES_URL }, + direct: { label: 'Flatpak, DEB & RPM', href: RELEASES_URL }, }, { name: 'macOS',