mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-04 15:52:24 -08:00
fix: make Linux distribution work via GoReleaser, drop nfpm config
This commit is contained in:
15 files changed
+381
-596
No files matched your search
+143
-184
@@ -17,6 +17,11 @@ concurrency:
|
||||
group: tauri-build-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
|
||||
cancel-in-progress: ${{ github.ref == 'refs/heads/dev' }}
|
||||
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TERM_COLOR: always
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
|
||||
jobs:
|
||||
setup-release:
|
||||
name: Resolve release target
|
||||
@@ -103,12 +108,6 @@ jobs:
|
||||
rust-targets: ''
|
||||
args: ''
|
||||
bundle_path: src-tauri/target/release/bundle
|
||||
- name: Linux (CEF)
|
||||
platform: ubuntu-22.04
|
||||
asset-platform: linux-x86_64
|
||||
rust-targets: ''
|
||||
cef: true
|
||||
bundle_path: src-tauri/target/release/bundle
|
||||
env:
|
||||
TAG: ${{ needs.setup-release.outputs.tag }}
|
||||
VERSION: ${{ needs.setup-release.outputs.version }}
|
||||
@@ -119,9 +118,6 @@ jobs:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TERM_COLOR: always
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
steps:
|
||||
@@ -171,7 +167,6 @@ jobs:
|
||||
echo "TAURI_BUILD_ARGS=${ARGS# }" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build desktop bundles
|
||||
if: ${{ !matrix.cef }}
|
||||
shell: bash
|
||||
run: pnpm tauri build ${{ matrix.args }} $TAURI_BUILD_ARGS
|
||||
|
||||
@@ -189,7 +184,6 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Normalize desktop artifact names
|
||||
if: ${{ !matrix.cef }}
|
||||
shell: bash
|
||||
env:
|
||||
ASSET_PLATFORM: ${{ matrix.asset-platform }}
|
||||
@@ -225,7 +219,6 @@ jobs:
|
||||
src-tauri/target/release/bundle/nsis/*.sig
|
||||
|
||||
- name: Attach bundles to release
|
||||
if: ${{ !matrix.cef }}
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
@@ -238,74 +231,6 @@ jobs:
|
||||
gh release upload "$TAG" "$path" --clobber
|
||||
done
|
||||
|
||||
# --- Linux: CEF runtime, packaged as deb / rpm / AppImage ---
|
||||
- name: Remove cached CEF build outputs
|
||||
if: matrix.cef
|
||||
shell: bash
|
||||
run: |
|
||||
build_dir="src-tauri/target/release/build"
|
||||
if [ -d "$build_dir" ]; then
|
||||
find "$build_dir" -mindepth 1 -maxdepth 1 -type d -name 'cef-*' -print -exec rm -rf {} +
|
||||
fi
|
||||
|
||||
- name: Build CEF binary
|
||||
if: matrix.cef
|
||||
shell: bash
|
||||
run: pnpm tauri:cef build $TAURI_BUILD_ARGS
|
||||
|
||||
- name: Build native packages
|
||||
if: matrix.cef
|
||||
shell: bash
|
||||
run: mise run cef:package "$VERSION"
|
||||
|
||||
- name: Sign the AppImage for the updater
|
||||
if: ${{ matrix.cef && env.TAURI_SIGNING_PRIVATE_KEY != '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
for f in src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage; do
|
||||
[ -e "$f" ] || continue
|
||||
pnpm tauri signer sign "$f"
|
||||
done
|
||||
|
||||
- name: Attest Linux bundles
|
||||
if: matrix.cef
|
||||
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
|
||||
with:
|
||||
subject-path: |
|
||||
src-tauri/target/release/bundle/deb/*.deb
|
||||
src-tauri/target/release/bundle/rpm/*.rpm
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage
|
||||
src-tauri/target/release/bundle/appimage/*.sig
|
||||
|
||||
- name: Attach native packages to release
|
||||
if: matrix.cef
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
BUNDLE_PATH: ${{ matrix.bundle_path }}
|
||||
run: |
|
||||
BUNDLE="$BUNDLE_PATH"
|
||||
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
|
||||
echo "Uploading $f"
|
||||
gh release upload "$TAG" "$f" --clobber
|
||||
done
|
||||
|
||||
- name: Upload .deb as workflow artifact
|
||||
if: matrix.cef
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: sable-linux-deb
|
||||
path: ${{ matrix.bundle_path }}/deb/Sable-*-linux-x86_64.deb
|
||||
retention-days: 1
|
||||
|
||||
android:
|
||||
name: Build Android
|
||||
needs: setup-release
|
||||
@@ -326,10 +251,7 @@ jobs:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TERM_COLOR: always
|
||||
MISE_ENV: tauri
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
# Matches the ABIs passed to `tauri android build` below.
|
||||
RUST_TARGETS: aarch64-linux-android armv7-linux-androideabi
|
||||
ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }}
|
||||
@@ -466,9 +388,6 @@ jobs:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_TERM_COLOR: always
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
RUST_TARGETS: aarch64-apple-ios
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -635,7 +554,7 @@ jobs:
|
||||
|
||||
updater-manifest:
|
||||
name: Publish updater manifest
|
||||
needs: [setup-release, build]
|
||||
needs: [setup-release, build, linux]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
@@ -721,61 +640,138 @@ jobs:
|
||||
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' }}
|
||||
# Nightlies use `--snapshot`, which packages without publishing.
|
||||
linux:
|
||||
name: Build Linux (CEF)
|
||||
needs: setup-release
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 60
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
artifact-metadata: write
|
||||
env:
|
||||
TAG: ${{ needs.setup-release.outputs.tag }}
|
||||
VERSION: ${{ needs.setup-release.outputs.version }}
|
||||
VITE_APP_VERSION: ${{ needs.setup-release.outputs.version }}
|
||||
SABLE_BUILD_FLAVOR: ${{ needs.setup-release.outputs.nightly == 'true' && 'dev' || 'stable' }}
|
||||
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
|
||||
VITE_SENTRY_ENVIRONMENT: ${{ needs.setup-release.outputs.nightly == 'true' && 'preview' || 'production' }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
IS_NIGHTLY: ${{ needs.setup-release.outputs.nightly }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ needs.setup-release.outputs.ref }}
|
||||
# GoReleaser reads the version from git history.
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup tools (mise)
|
||||
uses: jdx/mise-action@dad1bfd3df957f44999b559dd69dc1671cb4e9ea # v4.2.1
|
||||
- name: Setup app
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
cache: true
|
||||
env: tauri
|
||||
tauri: 'true'
|
||||
|
||||
- name: Install system packages (including Flatpak build deps)
|
||||
run: mise bootstrap packages apply --yes
|
||||
- name: Cache Rust build
|
||||
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||
with:
|
||||
workspaces: src-tauri
|
||||
|
||||
- name: Add Flathub runtime + SDK
|
||||
run: |
|
||||
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
|
||||
- name: Stamp release version into tauri.conf.json
|
||||
shell: bash
|
||||
env:
|
||||
AUR_KEY: ${{ secrets.AUR_KEY }}
|
||||
UPDATER_ENDPOINT: ${{ needs.setup-release.outputs.nightly == 'true' && format('https://github.com/{0}/releases/download/nightly/latest.json', github.repository) || '' }}
|
||||
run: node .github/scripts/set-tauri-version.mjs "$VERSION" "$UPDATER_ENDPOINT"
|
||||
|
||||
# Not in [bootstrap.packages]: snapcraft ships only as a snap.
|
||||
- name: Install snapcraft
|
||||
if: ${{ needs.setup-release.outputs.nightly != 'true' }}
|
||||
run: sudo snap install snapcraft --classic
|
||||
|
||||
- name: Trust the AUR host key
|
||||
if: ${{ needs.setup-release.outputs.nightly != 'true' }}
|
||||
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: Resolve GoReleaser args
|
||||
id: gr
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$IS_NIGHTLY" = "true" ]; then
|
||||
echo 'args=release --clean --snapshot --skip=snapcraft,aur' >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo 'args=release --clean' >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
|
||||
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
|
||||
with:
|
||||
version: latest
|
||||
args: release --clean
|
||||
# The rust builder needs >= 2.5.
|
||||
version: '~> v2'
|
||||
args: ${{ steps.gr.outputs.args }}
|
||||
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 }}
|
||||
|
||||
- name: Build the AppImage
|
||||
shell: bash
|
||||
run: |
|
||||
DISPLAY_NAME=Sable
|
||||
[ "$IS_NIGHTLY" = "true" ] && DISPLAY_NAME="Sable Nightly"
|
||||
mise run cef:package "$VERSION" \
|
||||
src-tauri/target/x86_64-unknown-linux-gnu/release/sable "$DISPLAY_NAME"
|
||||
|
||||
- name: Sign the AppImage for the updater
|
||||
if: ${{ env.TAURI_SIGNING_PRIVATE_KEY != '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
for f in src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage; do
|
||||
[ -e "$f" ] || continue
|
||||
pnpm tauri signer sign "$f"
|
||||
done
|
||||
|
||||
- name: Attest Linux bundles
|
||||
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
|
||||
with:
|
||||
subject-path: |
|
||||
.goreleaser-dist/*.deb
|
||||
.goreleaser-dist/*.rpm
|
||||
.goreleaser-dist/*.pkg.tar.zst
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage
|
||||
src-tauri/target/release/bundle/appimage/*.sig
|
||||
|
||||
- name: Attach Linux packages to release
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
for f in .goreleaser-dist/Sable-*.deb \
|
||||
.goreleaser-dist/Sable-*.rpm \
|
||||
.goreleaser-dist/Sable-*.pkg.tar.zst \
|
||||
src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage \
|
||||
src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage.sig; do
|
||||
[ -e "$f" ] || continue
|
||||
echo "Uploading $f"
|
||||
gh release upload "$TAG" "$f" --clobber
|
||||
done
|
||||
|
||||
- name: Upload .deb as workflow artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: sable-linux-deb
|
||||
path: .goreleaser-dist/Sable-*.deb
|
||||
retention-days: 1
|
||||
|
||||
distribute-nightly-aur:
|
||||
name: Publish nightly to AUR
|
||||
needs: [setup-release, build]
|
||||
needs: [setup-release, linux]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
if: ${{ needs.setup-release.outputs.nightly == 'true' }}
|
||||
@@ -785,12 +781,12 @@ jobs:
|
||||
TAG: ${{ needs.setup-release.outputs.tag }}
|
||||
VERSION: ${{ needs.setup-release.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download .deb artifact and compute checksum
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: sable-linux-deb
|
||||
path: deb-artifact
|
||||
@@ -798,40 +794,55 @@ jobs:
|
||||
- name: Compute checksum
|
||||
shell: bash
|
||||
run: |
|
||||
cp deb-artifact/Sable-*-linux-x86_64.deb sable.deb
|
||||
SHA256=$(sha256sum sable.deb | awk '{print $1}')
|
||||
echo "SHA256=$SHA256" >> "$GITHUB_ENV"
|
||||
set -- deb-artifact/Sable-*-linux-x86_64.deb
|
||||
[ "$#" -eq 1 ] && [ -e "$1" ] || { echo "Expected exactly one .deb, got $*" >&2; exit 1; }
|
||||
echo "SHA256=$(sha256sum "$1" | awk '{print $1}')" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Push to AUR sable-nightly-bin
|
||||
shell: bash
|
||||
env:
|
||||
AUR_KEY: ${{ secrets.AUR_KEY }}
|
||||
run: |
|
||||
if [ -z "${AUR_KEY:-}" ]; then
|
||||
echo "::notice::AUR_KEY is not set; skipping the AUR publish."
|
||||
exit 0
|
||||
fi
|
||||
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
|
||||
export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/aur_key -o IdentitiesOnly=yes"
|
||||
|
||||
git clone "ssh://[email protected]/sable-nightly-bin.git" aur-repo
|
||||
cp packaging/aur/sable-nightly-bin.PKGBUILD packaging/aur/sable-nightly-bin.install aur-repo/
|
||||
cp packaging/aur/sable-nightly-bin.PKGBUILD aur-repo/PKGBUILD
|
||||
cp packaging/aur/sable-nightly-bin.install aur-repo/sable-nightly-bin.install
|
||||
|
||||
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
|
||||
# pkgver forbids '-'; _relver keeps the asset URL's form.
|
||||
sed -i \
|
||||
-e "s/^pkgver=.*/pkgver=${VERSION//-/.}/" \
|
||||
-e "s/^pkgrel=.*/pkgrel=1/" \
|
||||
-e "s/^_relver=.*/_relver=${VERSION}/" \
|
||||
-e "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"
|
||||
# makepkg refuses to run as root.
|
||||
docker run --rm -v "$PWD:/src:ro" archlinux:base-devel bash -c '
|
||||
useradd -m build
|
||||
cp /src/PKGBUILD /home/build/
|
||||
su build -c "cd /home/build && 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"
|
||||
if git diff --cached --quiet; then
|
||||
echo "Nothing changed; skipping the push."
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "nightly ${VERSION}"
|
||||
git push
|
||||
|
||||
# ─── Android distribution (GoReleaser doesn't cover these) ───────────────
|
||||
|
||||
distribute-obtainium:
|
||||
name: Generate Obtainium import file
|
||||
needs: [setup-release, android]
|
||||
@@ -843,7 +854,7 @@ jobs:
|
||||
TAG: ${{ needs.setup-release.outputs.tag }}
|
||||
VERSION: ${{ needs.setup-release.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -856,55 +867,3 @@ jobs:
|
||||
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
|
||||
Reference in new issue
Block a user