diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index 73f8c14e0..05c6f67ea 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -288,6 +288,9 @@ jobs: test -d "$BUNDLE" || { echo "Bundle directory not found: $BUNDLE" >&2; exit 1; } for f in "$BUNDLE"/deb/Sable-*-linux-x86_64.deb \ "$BUNDLE"/rpm/Sable-*-linux-x86_64.rpm \ + "$BUNDLE"/apk/Sable-*-linux-x86_64.apk \ + "$BUNDLE"/archlinux/Sable-*-x86_64.pkg.tar.zst \ + "$BUNDLE"/ipk/Sable-*-x86_64.ipk \ "$BUNDLE"/appimage/Sable-*-linux-x86_64.AppImage \ "$BUNDLE"/appimage/Sable-*-linux-x86_64.AppImage.sig; do [ -e "$f" ] || continue @@ -709,3 +712,183 @@ jobs: echo "Removing superseded nightly asset: $name" gh release delete-asset nightly "$name" --yes done + + # ─── Distribution via GoReleaser (AUR, Homebrew, Snap, Flatpak, Winget, Nix) ── + + goreleaser: + name: GoReleaser (AUR, Homebrew, Snap, Flatpak, Winget, Nix) + needs: [setup-release, build] + runs-on: ubuntu-latest + timeout-minutes: 30 + if: ${{ needs.setup-release.outputs.nightly != 'true' }} + permissions: + contents: write + env: + TAG: ${{ needs.setup-release.outputs.tag }} + VERSION: ${{ needs.setup-release.outputs.version }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup tools (mise) + uses: jdx/mise-action@dad1bfd3df957f44999b559dd69dc1671cb4e9ea # v4.2.1 + with: + cache: true + + - name: Install Flatpak build deps (for flatpak builder) + run: | + sudo apt-get update + sudo apt-get install -y flatpak flatpak-builder + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install -y org.gnome.Platform//50 org.gnome.Sdk//50 + + - name: Set up AUR SSH key + env: + AUR_KEY: ${{ secrets.AUR_KEY }} + run: | + mkdir -p ~/.ssh + printf '%s\n' "$AUR_KEY" > ~/.ssh/aur_key + chmod 600 ~/.ssh/aur_key + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN || github.token }} + AUR_KEY: ${{ secrets.AUR_KEY }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + + distribute-nightly-aur: + name: Publish nightly to AUR + needs: [setup-release, build] + runs-on: ubuntu-latest + timeout-minutes: 10 + if: ${{ needs.setup-release.outputs.nightly == 'true' }} + permissions: + contents: read + env: + TAG: ${{ needs.setup-release.outputs.tag }} + VERSION: ${{ needs.setup-release.outputs.version }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Download nightly .deb and compute checksum + shell: bash + run: | + curl -fsSL "https://github.com/${{ github.repository }}/releases/download/${TAG}/Sable-${VERSION}-linux-x86_64.deb" -o sable.deb + SHA256=$(sha256sum sable.deb | awk '{print $1}') + echo "SHA256=$SHA256" >> "$GITHUB_ENV" + + - name: Push to AUR sable-nightly-bin + shell: bash + env: + AUR_KEY: ${{ secrets.AUR_KEY }} + run: | + mkdir -p ~/.ssh + printf '%s\n' "$AUR_KEY" > ~/.ssh/aur_key + chmod 600 ~/.ssh/aur_key + ssh-keyscan -t ed25519 aur.archlinux.org >> ~/.ssh/known_hosts + + git clone "ssh://aur@aur.archlinux.org/sable-nightly-bin.git" aur-repo + cp packaging/aur/sable-nightly-bin.PKGBUILD packaging/aur/sable-nightly-bin.install aur-repo/ + + cd aur-repo + PKGVER="${VERSION%%-*}" + sed -i "s/^pkgver=.*/pkgver=${PKGVER}/" PKGBUILD + sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD + sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA256}')/" PKGBUILD + + docker run --rm -v "$PWD:/pkg" -w /pkg archlinux:latest bash -c \ + "pacman -Sy --noconfirm --needed base-devel && HOME=/root makepkg --printsrcinfo > .SRCINFO" + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add PKGBUILD sable-nightly-bin.install .SRCINFO + git commit -m "nightly ${VERSION}" || echo "No changes" + git push + + # ─── Android distribution (GoReleaser doesn't cover these) ─────────────── + + distribute-obtainium: + name: Generate Obtainium import file + needs: [setup-release, android] + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: write + env: + TAG: ${{ needs.setup-release.outputs.tag }} + VERSION: ${{ needs.setup-release.outputs.version }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Generate obtainium.json + shell: bash + run: node scripts/obtainium-generate.js "$VERSION" "$TAG" obtainium.json + + - name: Upload to release + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload "$TAG" obtainium.json --clobber + + distribute-fdroid: + name: Publish to self-hosted F-Droid repo + needs: [setup-release, android] + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + pages: write + env: + TAG: ${{ needs.setup-release.outputs.tag }} + VERSION: ${{ needs.setup-release.outputs.version }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Fetch existing F-Droid repo from Pages + shell: bash + run: | + mkdir -p repo + # Download existing repo contents so fdroid can re-index all versions + git clone --depth 1 --branch gh-pages \ + "https://github.com/${{ github.repository }}.git" pages-tmp 2>/dev/null || true + if [ -d pages-tmp/fdroid ]; then + cp -r pages-tmp/fdroid/. repo/ + fi + + - name: Download APK from release + shell: bash + run: | + curl -fsSL "https://github.com/${{ github.repository }}/releases/download/${TAG}/Sable-${VERSION}-android-universal.apk" \ + -o "repo/Sable-${VERSION}-android-universal.apk" + + - name: Set up fdroidserver + run: pip install fdroidserver + + - name: Update F-Droid repo index + shell: bash + run: | + if [ ! -f config.yml ]; then + fdroid init --repo repo + fi + fdroid update --create-metadata --repo repo + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@4c0d3854f0590c8a3f1d8c46d7d7805b2e540fe7 # v4.0.0 + with: + github_token: ${{ github.token }} + publish_dir: ./repo + destination_dir: fdroid + keep_files: true diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 000000000..0f225a373 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,251 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# Secrets: AUR_KEY, HOMEBREW_TAP_GITHUB_TOKEN, SNAPCRAFT_STORE_CREDENTIALS + +version: 2 + +project_name: sable + +before: + hooks: + - pnpm install --frozen-lockfile + - pnpm tauri build -- --no-bundle --features wry,updater + +builds: + - id: sable + main: ./src-tauri/ + binary: sable + goos: [linux, darwin, windows] + goarch: [amd64, arm64] + no_main_check: true + skip: true + +archives: + - id: sable + formats: + - tar.gz + name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}' + files: + - LICENSE + +nfpms: + - package_name: sable + file_name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Arch }}' + homepage: https://sable.moe + maintainer: SableClient + description: Sable, a Matrix client + license: AGPL-3.0-or-later + formats: + - deb + - rpm + - apk + - archlinux + - ipk + contents: + - src: opt/sable/ + dst: /opt/sable + type: tree + - src: usr/ + dst: /usr + type: tree + overrides: + deb: + dependencies: + - libgtk-3-0 + - libnss3 + - libnspr4 + - libgbm1 + - libdrm2 + - libxkbcommon0 + - libasound2 + - libcups2 + - xdg-utils + - xwayland + - libayatana-appindicator3-1 + rpm: + dependencies: + - gtk3 + - nss + - nspr + - mesa-libgbm + - libdrm + - libxkbcommon + - alsa-lib + - cups-libs + - xdg-utils + - xorg-x11-server-Xwayland + - libayatana-appindicator3.so.1()(64bit) + apk: + dependencies: + - webkit2gtk-4.1 + - gtk+3.0 + - libayatana-appindicator + - librsvg + - xdotool + - mesa-gbm + - libdrm + - libxkbcommon + - alsa-lib + - cups + - xdg-utils + - libxcomposite + - ttf-freefont + archlinux: + dependencies: + - webkit2gtk-4.1 + - gtk3 + - libayatana-appindicator + - librsvg + - xdotool + - hicolor-icon-theme + - desktop-file-utils + ipk: + dependencies: + - webkit2gtk-4.1 + - gtk3 + - libayatana-appindicator3 + - librsvg + - xdotool + +aurs: + - name: sable-bin + homepage: https://sable.moe + description: Sable, a Matrix client + maintainers: + - SableClient + license: AGPL-3.0-or-later + private_key: '{{ .Env.AUR_KEY }}' + git_url: ssh://aur@aur.archlinux.org/sable-bin.git + depends: + - webkit2gtk-4.1 + - gtk3 + - libayatana-appindicator + - librsvg + - xdotool + - hicolor-icon-theme + - desktop-file-utils + package: |- + ar x "{{ .ArtifactName }}" data.tar.xz + tar -xf data.tar.xz -C "${pkgdir}" + find "${pkgdir}" -type d -exec chmod 755 {} + + commit_author: + name: github-actions[bot] + email: github-actions[bot]@users.noreply.github.com + +homebrew_casks: + - name: sable + homepage: https://sable.moe + description: Sable, a Matrix client + binaries: + - Sable.app + repository: + owner: SableClient + name: homebrew-sable + branch: main + commit_author: + name: github-actions[bot] + email: github-actions[bot]@users.noreply.github.com + zap: + trash: + - ~/Library/Application Support/moe.sable.client + - ~/Library/Caches/moe.sable.client + - ~/Library/Preferences/moe.sable.client.plist + - ~/Library/Saved Application State/moe.sable.client.savedState + +snapcrafts: + - name: sable + summary: Sable, a Matrix client + description: | + Sable is a cross-platform Matrix client built with Tauri, offering a + native desktop experience with end-to-end encryption support. + grade: stable + confinement: strict + base: core22 + publish: true + layout: + /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.1: + bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.1 + apps: + sable: + command: usr/bin/sable + desktop: usr/share/applications/sable.desktop + extensions: [gnome] + environment: + WEBKIT_DISABLE_DMABUF_RENDERER: '1' + plugs: + - network + - network-bind + - home + - removable-media + - browser-support + +flatpak: + - app_id: moe.sable.Sable + runtime: org.gnome.Platform + runtime_version: '50' + sdk: org.gnome.Sdk + command: sable + finish_args: + - --socket=wayland + - --socket=fallback-x11 + - --device=dri + - --share=ipc + - --share=network + - --talk-name=org.freedesktop.Notifications + - --talk-name=org.kde.StatusNotifierWatcher + +winget: + - name: sable + publisher: SableClient + license: AGPL-3.0-or-later + homepage: https://sable.moe + short_description: Sable, a Matrix client + package_identifier: SableClient.Sable + repository: + owner: microsoft + name: winget-pkgs + branch: master + +scoops: + - name: sable + homepage: https://sable.moe + description: Sable, a Matrix client + license: AGPL-3.0-or-later + repository: + owner: SableClient + name: scoop-sable + branch: main + +nix: + - name: sable + homepage: https://sable.moe + description: Sable, a Matrix client + license: agpl3Plus + repository: + owner: SableClient + name: nixpkgs-sable + branch: main + +checksum: + name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' + algorithm: sha256 + +changelog: + sort: asc + use: git + filters: + exclude: + - '^chore:' + - '^docs:' + - '^style:' + - '^test:' + +release: + github: + owner: SableClient + name: Sable + draft: false + prerelease: auto + name_template: '{{ .ProjectName }} v{{ .Version }}' + extra_files: + - glob: packaging/flatpak/moe.sable.Sable.desktop + - glob: packaging/flatpak/moe.sable.Sable.metainfo.xml diff --git a/mise.tauri.toml b/mise.tauri.toml index 116c3f729..24a808864 100644 --- a/mise.tauri.toml +++ b/mise.tauri.toml @@ -1,5 +1,5 @@ # Tauri-specific dev tools and system dependencies. -# Loaded via `MISE_ENV=tauri` (set by `mise run setup:tauri` or CI). +# Loaded via `MISE_ENV=tauri` (set by the `tauri:setup` task's env, or CI). [env] ANDROID_NDK_VERSION = "29.0.14206865" diff --git a/mise.toml b/mise.toml index 7f9f98715..a3d628b71 100644 --- a/mise.toml +++ b/mise.toml @@ -58,7 +58,7 @@ tools = { "cargo:knope" = "0.23.0", cargo-binstall = "1.20.1" } [tasks."knope:document-change"] description = "Document a change with knope" -alias = ["doc", "doc"] +alias = ["doc", "dc"] run = { task = "knope", args = ["document-change"] } [tasks."tauri:setup"] diff --git a/nfpm.yaml b/nfpm.yaml index e6b78751e..46702ce49 100644 --- a/nfpm.yaml +++ b/nfpm.yaml @@ -10,6 +10,7 @@ section: net maintainer: SableClient description: Sable, a Matrix client homepage: https://sable.moe +license: AGPL-3.0-or-later contents: - src: ${PKGROOT}/opt/sable/ @@ -48,3 +49,34 @@ overrides: - xdg-utils - xorg-x11-server-Xwayland - libayatana-appindicator3.so.1()(64bit) + apk: + depends: + - webkit2gtk-4.1 + - gtk+3.0 + - libayatana-appindicator + - librsvg + - xdotool + - mesa-gbm + - libdrm + - libxkbcommon + - alsa-lib + - cups + - xdg-utils + - libxcomposite + - ttf-freefont + archlinux: + depends: + - webkit2gtk-4.1 + - gtk3 + - libayatana-appindicator + - librsvg + - xdotool + - hicolor-icon-theme + - desktop-file-utils + ipk: + depends: + - webkit2gtk-4.1 + - gtk3 + - libayatana-appindicator3 + - librsvg + - xdotool diff --git a/packaging/aur/sable-nightly-bin.PKGBUILD b/packaging/aur/sable-nightly-bin.PKGBUILD new file mode 100644 index 000000000..c98376710 --- /dev/null +++ b/packaging/aur/sable-nightly-bin.PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Sable Maintainers + +pkgname=sable-nightly-bin +pkgver=1.20.1 +pkgrel=1 +pkgdesc="An almost stable Matrix client (nightly builds)" +arch=('x86_64') +url="https://github.com/SableClient/Sable" +license=('AGPL-3.0-or-later') +depends=( + 'webkit2gtk-4.1' + 'gtk3' + 'libayatana-appindicator' + 'librsvg' + 'xdotool' + 'hicolor-icon-theme' + 'desktop-file-utils' +) +provides=('sable') +conflicts=('sable' 'sable-bin') +options=('!strip' '!debug') +install=${pkgname}.install +source_x86_64=("${pkgname}_${pkgver}_amd64.deb::${url}/releases/download/nightly/Sable-${pkgver}-linux-x86_64.deb") +sha256sums_x86_64=('SKIP') + +package() { + ar x "${srcdir}/${pkgname}_${pkgver}_amd64.deb" data.tar.xz + tar -xf data.tar.xz -C "${pkgdir}" + find "${pkgdir}" -type d -exec chmod 755 {} + +} diff --git a/packaging/aur/sable-nightly-bin.install b/packaging/aur/sable-nightly-bin.install new file mode 100644 index 000000000..d0261dd99 --- /dev/null +++ b/packaging/aur/sable-nightly-bin.install @@ -0,0 +1,13 @@ +post_install() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + update-desktop-database -q +} + +post_upgrade() { + post_install +} + +post_remove() { + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + update-desktop-database -q +} diff --git a/packaging/flatpak/moe.sable.Sable.desktop b/packaging/flatpak/moe.sable.Sable.desktop new file mode 100644 index 000000000..2f13034bb --- /dev/null +++ b/packaging/flatpak/moe.sable.Sable.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=Sable +Comment=An almost stable Matrix client +Exec=sable %U +Icon=moe.sable.Sable +Terminal=false +Categories=Network;InstantMessaging;Chat; +StartupWMClass=sable +MimeType=x-scheme-handler/sable;x-scheme-handler/moe.sable.app; diff --git a/packaging/flatpak/moe.sable.Sable.metainfo.xml b/packaging/flatpak/moe.sable.Sable.metainfo.xml new file mode 100644 index 000000000..b56ca273d --- /dev/null +++ b/packaging/flatpak/moe.sable.Sable.metainfo.xml @@ -0,0 +1,38 @@ + + + moe.sable.Sable + + Sable + An almost stable Matrix client + Sable Maintainers + https://sable.moe + https://github.com/SableClient/Sable/issues + https://github.com/SableClient/Sable + + + CC0-1.0 + AGPL-3.0-or-later + + + pointing + keyboard + touch + + + +

+ Sable is a cross-platform Matrix client built with Tauri, offering a + native desktop experience with end-to-end encryption support. +

+
+ + moe.sable.Sable.desktop + + + + +

See the changelog at https://github.com/SableClient/Sable/releases

+
+
+
+
diff --git a/scripts/cef/package.sh b/scripts/cef/package.sh index d1be2d9ab..3a6b17d61 100755 --- a/scripts/cef/package.sh +++ b/scripts/cef/package.sh @@ -110,13 +110,24 @@ EOF cp "src-tauri/icons/128x128@2x.png" \ "$PKGROOT/usr/share/icons/hicolor/256x256/apps/sable.png" + mkdir -p "$OUT/deb" "$OUT/rpm" "$OUT/apk" "$OUT/archlinux" "$OUT/ipk" + PKG_VERSION="$DEB_VERSION" PKG_RELEASE=1 nfpm pkg -f "$CONFIG" -p deb \ -t "$OUT/deb/Sable-${VERSION}-linux-x86_64.deb" PKG_VERSION="$RPM_VERSION" PKG_RELEASE="$RPM_ITERATION" nfpm pkg -f "$CONFIG" -p rpm \ -t "$OUT/rpm/Sable-${VERSION}-linux-x86_64.rpm" + + PKG_VERSION="$DEB_VERSION" PKG_RELEASE=1 nfpm pkg -f "$CONFIG" -p apk \ + -t "$OUT/apk/Sable-${VERSION}-linux-x86_64.apk" + + PKG_VERSION="$VERSION" PKG_RELEASE=1 nfpm pkg -f "$CONFIG" -p archlinux \ + -t "$OUT/archlinux/Sable-${VERSION}-x86_64.pkg.tar.zst" + + PKG_VERSION="$DEB_VERSION" PKG_RELEASE=1 nfpm pkg -f "$CONFIG" -p ipk \ + -t "$OUT/ipk/Sable-${VERSION}-x86_64.ipk" else - echo "nfpm not found; skipping deb/rpm" + echo "nfpm not found; skipping native packages" fi APPIMAGETOOL_CMD=""