[V1] Prepared for v0.3.0 Release

This commit is contained in:
Youwes09
2026-02-24 20:18:45 -06:00
parent 7d3d76fa6d
commit ac04c39ead
8 changed files with 159 additions and 129 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
pkgname=moku pkgname=moku
pkgver=0.2.0 pkgver=0.3.0
pkgrel=1 pkgrel=1
pkgdesc="Native Linux manga reader frontend for Suwayomi-Server" pkgdesc="Native Linux manga reader frontend for Suwayomi-Server"
arch=('x86_64') arch=('x86_64')
@@ -22,7 +22,7 @@ source=(
"suwayomi-server.jar::https://github.com/Suwayomi/Suwayomi-Server/releases/download/v2.1.1867/suwayomi-server-v2.1.1867.jar" "suwayomi-server.jar::https://github.com/Suwayomi/Suwayomi-Server/releases/download/v2.1.1867/suwayomi-server-v2.1.1867.jar"
"jdk.tar.gz::https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jre_x64_linux_hotspot_21.0.3_9.tar.gz" "jdk.tar.gz::https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jre_x64_linux_hotspot_21.0.3_9.tar.gz"
) )
sha256sums=('dfd110ae4f11711ce979020ae65b08ab2d0bd51ecc1ba877ba1780ba037357a4' sha256sums=('2475d4bb4c7e8527384f7fcf9b0ace1c8a6354416f3af31398b844e35953fb73'
'51e307c2581e4e1a002991ab3e3a77503c8b074c42695987a984a7382d0ac5af' '51e307c2581e4e1a002991ab3e3a77503c8b074c42695987a984a7382d0ac5af'
'f1af100c4afca2035f446967323230150cfe5872b5a664d98c86963e5c066e0d') 'f1af100c4afca2035f446967323230150cfe5872b5a664d98c86963e5c066e0d')
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# build-scripts/pkgbuild-bump.sh
# ─────────────────────────────────────────────────────────────────────────────
# Run this AFTER the git tag has been pushed to GitHub.
#
# Usage:
# ./build-scripts/pkgbuild-bump.sh 0.3.0
set -euo pipefail
RED='\033[0;31m'; GREEN='\033[0;32m'; CYAN='\033[0;36m'; BOLD='\033[1m'; RESET='\033[0m'
info() { echo -e "${CYAN}${RESET} $*"; }
success() { echo -e "${GREEN}${RESET} $*"; }
die() { echo -e "${RED}${RESET} $*" >&2; exit 1; }
section() { echo -e "\n${BOLD}── $* ──${RESET}"; }
[[ $# -lt 1 ]] && die "Usage: $0 <version>"
VERSION="$1"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
PKGBUILD="${REPO_ROOT}/PKGBUILD"
command -v curl &>/dev/null || die "curl not found"
[[ -f "$PKGBUILD" ]] || die "PKGBUILD not found: $PKGBUILD"
section "Patching PKGBUILD → ${VERSION}"
TARBALL_URL="https://github.com/Youwes09/Moku/archive/refs/tags/v${VERSION}.tar.gz"
info "Fetching source tarball to compute sha256…"
TARBALL_SHA=$(curl -fsSL "$TARBALL_URL" | sha256sum | awk '{print $1}')
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" "$PKGBUILD"
sed -i "s/^pkgrel=.*/pkgrel=1/" "$PKGBUILD"
# Replace only the first sha256 entry (source tarball) inside sha256sums=('...')
# The suwayomi jar and jdk hashes are pinned and stay untouched.
# Strategy: match the opening sha256sums=('' then swap just that first hash.
sed -i "s/\(sha256sums=('\)[0-9a-f]\{64\}/\1${TARBALL_SHA}/" "$PKGBUILD"
# Verify the replacement landed
if ! grep -q "$TARBALL_SHA" "$PKGBUILD"; then
die "sha256 replacement failed — check PKGBUILD sha256sums format"
fi
success "PKGBUILD patched (pkgver=${VERSION}, sha256=${TARBALL_SHA})"
info "PKGBUILD → ${PKGBUILD}"
+39 -110
View File
@@ -2,18 +2,14 @@
# build-scripts/release.sh # build-scripts/release.sh
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# Usage: # Usage:
# ./build-scripts/release.sh 0.2.0 — full release (AUR + Flatpak) # ./build-scripts/release.sh 0.2.0
# ./build-scripts/release.sh 0.2.0 --aur — AUR bin package only
# ./build-scripts/release.sh 0.2.0 --flatpak — Flatpak sources + bundle only
# #
# Requires: nix, podman (for AUR .SRCINFO generation in Arch container) # Requires: nix, flatpak-builder, appstream
set -euo pipefail set -euo pipefail
# ── Colour helpers ───────────────────────────────────────────────────────────── # ── Colour helpers ─────────────────────────────────────────────────────────────
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m' RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
CYAN='\033[0;36m'; BOLD='\033[1m'; RESET='\033[0m' CYAN='\033[0;36m'; BOLD='\033[1m'; RESET='\033[0m'
info() { echo -e "${CYAN}${RESET} $*"; } info() { echo -e "${CYAN}${RESET} $*"; }
success() { echo -e "${GREEN}${RESET} $*"; } success() { echo -e "${GREEN}${RESET} $*"; }
warn() { echo -e "${YELLOW}${RESET} $*"; } warn() { echo -e "${YELLOW}${RESET} $*"; }
@@ -21,31 +17,23 @@ die() { echo -e "${RED} ✗${RESET} $*" >&2; exit 1; }
section() { echo -e "\n${BOLD}── $* ──${RESET}"; } section() { echo -e "\n${BOLD}── $* ──${RESET}"; }
# ── Args ─────────────────────────────────────────────────────────────────────── # ── Args ───────────────────────────────────────────────────────────────────────
[[ $# -lt 1 ]] && die "Usage: $0 <version> [--aur|--flatpak]" [[ $# -lt 1 ]] && die "Usage: $0 <version>"
VERSION="$1" VERSION="$1"
MODE="${2:-all}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
AUR_DIR="${REPO_ROOT}/../moku-bin"
TARBALL="moku-${VERSION}-x86_64.tar.gz"
FLATPAK_MANIFEST="${REPO_ROOT}/dev.moku.app.yml" FLATPAK_MANIFEST="${REPO_ROOT}/dev.moku.app.yml"
PKGBUILD="${REPO_ROOT}/PKGBUILD"
# ── Sanity checks ────────────────────────────────────────────────────────────── # ── Sanity checks ──────────────────────────────────────────────────────────────
section "Pre-flight" section "Pre-flight"
command -v nix &>/dev/null || die "nix not found" command -v nix &>/dev/null || die "nix not found"
command -v curl &>/dev/null || die "curl not found"
if [[ "$MODE" == "all" || "$MODE" == "--aur" ]]; then [[ -f "$FLATPAK_MANIFEST" ]] || die "Flatpak manifest not found: $FLATPAK_MANIFEST"
command -v podman &>/dev/null || die "podman not found — needed for Arch container (makepkg)" [[ -f "$PKGBUILD" ]] || die "PKGBUILD not found: $PKGBUILD"
[[ -d "$AUR_DIR" ]] || die "AUR dir not found at $AUR_DIR\nClone it first:\n git clone ssh://aur@aur.archlinux.org/moku-bin.git ../moku-bin"
[[ -f "${AUR_DIR}/PKGBUILD" ]] || die "PKGBUILD not found in $AUR_DIR"
fi
success "OK" success "OK"
# ── Bump versions ────────────────────────────────────────────────────────────── # ── Bump versions ──────────────────────────────────────────────────────────────
section "Bumping version → ${VERSION}" section "Bumping version → ${VERSION}"
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" \ sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${VERSION}\"/" \
"${REPO_ROOT}/src-tauri/tauri.conf.json" "${REPO_ROOT}/src-tauri/tauri.conf.json"
success "tauri.conf.json → ${VERSION}" success "tauri.conf.json → ${VERSION}"
@@ -54,6 +42,12 @@ sed -i "0,/^version = \"[^\"]*\"/s//version = \"${VERSION}\"/" \
"${REPO_ROOT}/src-tauri/Cargo.toml" "${REPO_ROOT}/src-tauri/Cargo.toml"
success "Cargo.toml → ${VERSION}" success "Cargo.toml → ${VERSION}"
# flake.nix has two `version = "x.y.z";` strings inside the frontend
# derivation and fetchPnpmDeps — both need to match.
sed -i "s/version = \"[^\"]*\";/version = \"${VERSION}\";/g" \
"${REPO_ROOT}/flake.nix"
success "flake.nix → ${VERSION}"
# ── Build frontend ───────────────────────────────────────────────────────────── # ── Build frontend ─────────────────────────────────────────────────────────────
section "Building frontend" section "Building frontend"
cd "$REPO_ROOT" cd "$REPO_ROOT"
@@ -61,37 +55,26 @@ nix develop --command pnpm install --frozen-lockfile
nix develop --command pnpm build nix develop --command pnpm build
success "Frontend built → dist/" success "Frontend built → dist/"
# ── Build Rust binary ──────────────────────────────────────────────────────────
section "Building Rust binary"
nix develop --command cargo build --release --manifest-path src-tauri/Cargo.toml
BINARY="${REPO_ROOT}/src-tauri/target/release/moku"
[[ -f "$BINARY" ]] || die "Binary not found: $BINARY"
success "Binary → $BINARY"
# ── Flatpak ──────────────────────────────────────────────────────────────────── # ── Flatpak ────────────────────────────────────────────────────────────────────
if [[ "$MODE" == "all" || "$MODE" == "--flatpak" ]]; then section "Regenerating cargo-sources.json"
section "Regenerating cargo-sources.json" cd "$REPO_ROOT"
cd "$REPO_ROOT" nix-shell \
nix-shell \
-p "python311.withPackages(ps: [ ps.aiohttp ps.tomlkit ])" \ -p "python311.withPackages(ps: [ ps.aiohttp ps.tomlkit ])" \
--run "python3 packaging/flatpak-cargo-generator.py src-tauri/Cargo.lock -o packaging/cargo-sources.json" --run "python3 packaging/flatpak-cargo-generator.py src-tauri/Cargo.lock -o packaging/cargo-sources.json"
success "cargo-sources.json updated" success "cargo-sources.json updated"
section "Rebuilding frontend-dist.tar.gz" section "Rebuilding frontend-dist.tar.gz"
tar -czf packaging/frontend-dist.tar.gz -C dist . tar -czf packaging/frontend-dist.tar.gz -C dist .
FRONTEND_SHA=$(sha256sum packaging/frontend-dist.tar.gz | awk '{print $1}') FRONTEND_SHA=$(sha256sum packaging/frontend-dist.tar.gz | awk '{print $1}')
success "frontend-dist.tar.gz rebuilt sha256: ${FRONTEND_SHA}" success "frontend-dist.tar.gz rebuilt sha256: ${FRONTEND_SHA}"
# Patch the sha256 in dev.moku.app.yml automatically via a temp script section "Patching frontend-dist sha256 in dev.moku.app.yml"
PATCH_SCRIPT=$(mktemp /tmp/patch-sha256-XXXXXX.py) PATCH_SCRIPT=$(mktemp /tmp/patch-sha256-XXXXXX.py)
cat > "$PATCH_SCRIPT" << PYEOF cat > "$PATCH_SCRIPT" << PYEOF
import re, sys import re, sys
path = "${FLATPAK_MANIFEST}" path = "${FLATPAK_MANIFEST}"
new_sha = "${FRONTEND_SHA}" new_sha = "${FRONTEND_SHA}"
text = open(path).read() text = open(path).read()
pattern = r'(path:\s*packaging/frontend-dist\.tar\.gz\s*\n\s*sha256:\s*)[0-9a-f]+' pattern = r'(path:\s*packaging/frontend-dist\.tar\.gz\s*\n\s*sha256:\s*)[0-9a-f]+'
replacement = r'\g<1>' + new_sha replacement = r'\g<1>' + new_sha
updated, n = re.subn(pattern, replacement, text) updated, n = re.subn(pattern, replacement, text)
@@ -99,86 +82,32 @@ if n == 0:
sys.exit("Could not find frontend-dist sha256 in dev.moku.app.yml") sys.exit("Could not find frontend-dist sha256 in dev.moku.app.yml")
open(path, 'w').write(updated) open(path, 'w').write(updated)
PYEOF PYEOF
nix-shell -p python3 --run "python3 '$PATCH_SCRIPT'" nix-shell -p python3 --run "python3 '$PATCH_SCRIPT'"
rm -f "$PATCH_SCRIPT" rm -f "$PATCH_SCRIPT"
success "dev.moku.app.yml sha256 updated" success "dev.moku.app.yml sha256 updated"
section "Building Flatpak bundle" section "Building Flatpak bundle"
rm -rf "${REPO_ROOT}/build-dir" "${REPO_ROOT}/repo" rm -rf "${REPO_ROOT}/build-dir" "${REPO_ROOT}/repo"
nix shell nixpkgs#appstream nixpkgs#flatpak-builder --command \
nix shell nixpkgs#appstream nixpkgs#flatpak-builder --command \
flatpak-builder \ flatpak-builder \
--repo="${REPO_ROOT}/repo" \ --repo="${REPO_ROOT}/repo" \
--force-clean \ --force-clean \
"${REPO_ROOT}/build-dir" \ "${REPO_ROOT}/build-dir" \
"$FLATPAK_MANIFEST" "$FLATPAK_MANIFEST"
flatpak build-bundle \ flatpak build-bundle \
"${REPO_ROOT}/repo" \ "${REPO_ROOT}/repo" \
"${REPO_ROOT}/moku.flatpak" \ "${REPO_ROOT}/moku.flatpak" \
dev.moku.app dev.moku.app
# Clean up intermediate build artefacts — keep only moku.flatpak rm -rf "${REPO_ROOT}/build-dir" "${REPO_ROOT}/repo"
rm -rf "${REPO_ROOT}/build-dir" "${REPO_ROOT}/repo" success "moku.flatpak created"
success "moku.flatpak created"
fi
# ── AUR tarball + PKGBUILD ─────────────────────────────────────────────────────
if [[ "$MODE" == "all" || "$MODE" == "--aur" ]]; then
section "Assembling release tarball"
cd "$REPO_ROOT"
STAGE="release-${VERSION}"
rm -rf "$STAGE"
install -Dm755 "$BINARY" "${STAGE}/usr/bin/moku"
install -Dm644 packaging/dev.moku.app.desktop "${STAGE}/usr/share/applications/dev.moku.app.desktop"
install -Dm644 src-tauri/icons/32x32.png "${STAGE}/usr/share/icons/hicolor/32x32/apps/dev.moku.app.png"
install -Dm644 src-tauri/icons/128x128.png "${STAGE}/usr/share/icons/hicolor/128x128/apps/dev.moku.app.png"
install -Dm644 "src-tauri/icons/128x128@2x.png" "${STAGE}/usr/share/icons/hicolor/256x256/apps/dev.moku.app.png"
install -Dm644 packaging/dev.moku.app.metainfo.xml "${STAGE}/usr/share/metainfo/dev.moku.app.metainfo.xml"
tar -czf "$TARBALL" "$STAGE/"
AUR_SHA=$(sha256sum "$TARBALL" | awk '{print $1}')
rm -rf "$STAGE"
success "Tarball: ${TARBALL} sha256: ${AUR_SHA}"
section "Patching PKGBUILD"
PKGBUILD="${AUR_DIR}/PKGBUILD"
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" "$PKGBUILD"
sed -i "s/^pkgrel=.*/pkgrel=1/" "$PKGBUILD"
sed -i "s/sha256sums=('[^']*')/sha256sums=('${AUR_SHA}')/" "$PKGBUILD"
success "PKGBUILD patched"
# Tarball is only needed for the GitHub upload — remind user then it can go
info "Tarball kept at ${REPO_ROOT}/${TARBALL} — upload it to GitHub, then it can be deleted"
section "Generating .SRCINFO (Arch container)"
# Mount only the AUR dir into a throwaway Arch container and run makepkg
podman run --rm \
--volume "${AUR_DIR}:/aur:z" \
--workdir /aur \
archlinux:latest \
bash -c "
pacman -Sy --noconfirm pacman >/dev/null 2>&1
source PKGBUILD
makepkg --printsrcinfo > .SRCINFO
"
success ".SRCINFO generated"
section "Next steps"
echo ""
echo -e " ${BOLD}1. Upload tarball to GitHub:${RESET}"
echo -e " ${CYAN}gh release create v${VERSION} '${REPO_ROOT}/${TARBALL}' --title 'v${VERSION}' --generate-notes${RESET}"
echo ""
echo -e " ${BOLD}2. Push AUR:${RESET}"
echo -e " ${CYAN}cd ${AUR_DIR}${RESET}"
echo -e " ${CYAN}git add PKGBUILD .SRCINFO${RESET}"
echo -e " ${CYAN}git commit -m 'Update to ${VERSION}'${RESET}"
echo -e " ${CYAN}git push origin master${RESET}"
echo ""
echo -e " ${BOLD}3. Clean up:${RESET}"
echo -e " ${CYAN}rm -f ${REPO_ROOT}/${TARBALL}${RESET}"
fi
# ── Done ───────────────────────────────────────────────────────────────────────
echo "" echo ""
success "v${VERSION} ready" success "v${VERSION} ready"
info "Flatpak bundle → ${REPO_ROOT}/moku.flatpak"
echo ""
warn "PKGBUILD not patched yet — tag must exist on GitHub first."
info "After pushing the tag, run:"
echo -e " ${CYAN}./build-scripts/pkgbuild-bump.sh ${VERSION}${RESET}"
+1 -1
View File
@@ -181,7 +181,7 @@ modules:
path: . path: .
- type: file - type: file
path: packaging/frontend-dist.tar.gz path: packaging/frontend-dist.tar.gz
sha256: ac23bf503533711b19b7fd4b3ec04e081928f2f41b66d8391af1a9e36681548a sha256: c9bb5ee6613b2bc61e69a92cc1ef0029da3b61138d51b01d363f8ea524e51996
- packaging/cargo-sources.json - packaging/cargo-sources.json
- type: inline - type: inline
dest: src-tauri/.cargo dest: src-tauri/.cargo
+58 -2
View File
@@ -75,7 +75,7 @@
frontend = pkgs.stdenv.mkDerivation { frontend = pkgs.stdenv.mkDerivation {
pname = "moku-frontend"; pname = "moku-frontend";
version = "0.1.0"; version = "0.3.0";
src = frontendSrc; src = frontendSrc;
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
@@ -86,7 +86,7 @@
pnpmDeps = pkgs.fetchPnpmDeps { pnpmDeps = pkgs.fetchPnpmDeps {
pname = "moku-frontend"; pname = "moku-frontend";
version = "0.1.0"; version = "0.3.0";
src = frontendSrc; src = frontendSrc;
fetcherVersion = 1; fetcherVersion = 1;
hash = "sha256-bpGYsB534RPNNAcYR9BA61vvFpSG6Xu2hY923PakCyY="; hash = "sha256-bpGYsB534RPNNAcYR9BA61vvFpSG6Xu2hY923PakCyY=";
@@ -135,11 +135,67 @@
--prefix PATH : "${lib.makeBinPath [ pkgs.suwayomi-server ]}" \ --prefix PATH : "${lib.makeBinPath [ pkgs.suwayomi-server ]}" \
--set GDK_BACKEND wayland \ --set GDK_BACKEND wayland \
--set WEBKIT_FORCE_SANDBOX 0 --set WEBKIT_FORCE_SANDBOX 0
# Icon
# Tauri bakes several sizes into src-tauri/icons/. We prefer the
# largest PNG (512x512) for the hicolor theme, and also install the
# rounded 32x32 used as the in-app logo so small sizes look right.
# Adjust the source filenames if yours differ.
for size in 32x32 128x128 256x256 512x512; do
src="icons/$size.png"
if [ -f "$src" ]; then
install -Dm644 "$src" \
"$out/share/icons/hicolor/$size/apps/moku.png"
fi
done
# @2x variants that Tauri also generates
for size in 128x128 256x256; do
src="icons/''${size}@2x.png"
if [ -f "$src" ]; then
install -Dm644 "$src" \
"$out/share/icons/hicolor/''${size}@2/apps/moku.png"
fi
done
# Scalable SVG src/assets/moku-icon.svg is the rounded version
# referenced in SplashScreen.tsx. Pull it straight from the source
# tree so the launcher always uses the same rounded artwork.
install -Dm644 "${./src/assets/moku-icon.svg}" \
"$out/share/icons/hicolor/scalable/apps/moku.svg"
# .desktop entry
install -Dm644 /dev/stdin \
"$out/share/applications/moku.desktop" <<EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=Moku
Comment=Manga reader frontend for Suwayomi
Exec=$out/bin/moku
Icon=moku
Terminal=false
Categories=Graphics;Viewer;
Keywords=manga;comic;reader;suwayomi;
StartupWMClass=moku
EOF
''; '';
}); });
in in
{ {
# Expose as both a runnable app and installable packages.
apps = {
default = {
type = "app";
program = "${moku}/bin/moku";
};
moku = {
type = "app";
program = "${moku}/bin/moku";
};
};
packages = { packages = {
inherit moku frontend; inherit moku frontend;
default = moku; default = moku;
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "moku" name = "moku"
version = "0.2.0" version = "0.3.0"
edition = "2021" edition = "2021"
[lib] [lib]
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Moku", "productName": "Moku",
"version": "0.2.0", "version": "0.3.0",
"identifier": "dev.moku.app", "identifier": "dev.moku.app",
"build": { "build": {
"frontendDist": "../dist", "frontendDist": "../dist",