chore(ci): rebrand and streamline the release pipeline (#66)

* chore(ci): rebrand and streamline the release pipeline

- CI/CD:
  - replace the old `develop`/`master` pipelines with explicit validation, nightly, preview, and release workflows
  - switch stable releases to `main`, keep `develop` for nightly builds, and make preview image builds manual-only
  - update the reusable migration check so callers pass explicit refs and validation works correctly across PRs, pushes, and release flows

- Packaging:
  - consolidate container packaging onto the root `Dockerfile` and remove `Dockerfile.ci`
  - stop mutating tracked source files during image builds by building frontend and backend assets inside the container pipeline
  - remove vendored `unrar` binaries and build the upstream CLI from source during the image build
  - keep runtime compatibility for existing Booklore deployments by preserving env vars, ports, mount paths, and legacy internal user defaults

- Deploy Surface:
  - move deployment examples under `deploy/` and Docker runtime assets under `packaging/docker`
  - rebrand image, chart, and helper-script references from Booklore to Grimmory on the build and release surfaces only
  - update Compose, Helm, and Podman examples to reflect Grimmory image names and the stable/nightly tag model

- Docs:
  - add the implementation plan under `docs/plans/ci-cd-rebrand-main-nightly.md`
  - refresh README, contributing guidance, PR template, and operational docs to match the new branch, image, and upgrade story
  - document the Booklore-to-Grimmory image swap path so existing self-hosted installs can upgrade by changing only the image reference

- Validation:
  - pass `git diff --check`
  - parse all workflow YAML successfully
  - pass `shellcheck` on the touched shell scripts

* fix(ci): address review feedback and dedupe test workflows

- Workflows:
  - extract backend and frontend test execution into a shared reusable workflow used by validation, nightly, and release pipelines
  - simplify migration ref handling, sanitize manual preview PR inputs, reduce preview cache writes, and update Flyway to the current image tag
  - remove unnecessary duplicated job definitions so the test path has one source of truth

- Packaging:
  - verify the downloaded UnRAR source tarball with SHA256 before extraction
  - remove the unnecessary forced npm install path from the production Docker build
  - harden container startup by failing clearly when APP_USER collides with an unexpected UID or GID

- Versioning and deploy docs:
  - keep app version metadata embedded in the built image instead of asking operators to set APP_VERSION in deploy examples
  - update runtime release links and support links to the Grimmory repository
  - add the Quadlet install section and finish the remaining review-targeted doc fixes and branding cleanup

- Validation:
  - pass git diff --check
  - pass shellcheck on packaging/docker/entrypoint.sh
  - parse all GitHub workflow YAML successfully

* fix: Resolve flyway version

* fix: Resolve some noise in readme

* feat(release): migrate stable releases to semantic-release

- Release automation:
  - replace the manual stable bump flow and Release Drafter with semantic-release on `main`
  - split stable delivery into a semantic-release workflow that computes version, changelog, tag, and draft GitHub release plus a tag-driven workflow that publishes container images
  - add a maintainer-run dry-run workflow to preview the next stable version and release notes before publishing

- Release tooling:
  - add a dedicated `tools/release` package with semantic-release configuration and lockfile
  - encode Grimmory's release policy so `feat` triggers minor releases, `fix`/`perf`/`refactor` trigger patch releases, and `docs`/`ci`/`build`/`chore`/`test`/`style` are changelog-only
  - maintain a committed `CHANGELOG.md` and draft GitHub releases from the same release notes source

- Contributor workflow:
  - enforce conventional PR titles for PRs targeting `develop` and `main`
  - document that feature work is squash-merged into `develop` and that stable releases are computed from the preserved conventional commit history promoted to `main`
  - update README, contributing guidance, and the PR template to match the new release process

- Bootstrap:
  - add the semantic-release migration plan under `docs/plans/semantic-release-migration.md`
  - seed the local release baseline with `v2.2.1` on commit `384512534fe5a2f42d8482a0646337e28ef54e52`
  - configure the stable image publish workflow to ignore the bootstrap tag so the first semantic-release-managed release can be `v2.2.2`

- Validation:
  - pass `git diff --check`
  - parse all workflow YAML successfully
  - verify the semantic-release config loads correctly
  - verify the local bootstrap tag is present as `v2.2.1`

* Add proper concurrency to prevent version collisions

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Tighten the release preview gate to ensure commits are present in origin/head

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update README.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix(ci): fail migration checks on missing diff base

- Migration checks:
  - remove the implicit fallback that rewrote an all-zero base ref to `head^`
  - fail fast when callers provide the all-zero sentinel instead of a real comparison base so multi-commit pushes and root-history cases do not silently skip migration files

- Validation:
  - pass `git diff --check`
  - parse `.github/workflows/migrations-check.yml` successfully

* fix(packaging): source unrar from linuxserver layer

- Container packaging:
  - replace the custom UnRAR source build stage with the published `linuxserver/unrar` image layer
  - copy the provided `/usr/bin/unrar-alpine` binary into the final runtime image as `/usr/local/bin/unrar`
  - remove the checksum, tarball, and local compile path from the Dockerfile

- Validation:
  - pass `git diff --check`

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
James Cox
2026-03-19 18:46:54 -05:00
committed by GitHub
co-authored by coderabbitai[bot]
parent 6b0c4aa66c
commit 1bc45da013
59 changed files with 7445 additions and 1061 deletions
+8 -9
View File
@@ -1,15 +1,14 @@
.git
.github
.idea
.vscode
.angular
**
!Dockerfile
!.dockerignore
!booklore-api/**
!booklore-ui/**
!packaging/docker/**
booklore-ui/node_modules
booklore-ui/dist
booklore-ui/.angular
booklore-ui/test-results
booklore-api/build/reports
booklore-api/build/test-results
*.md
booklore-api/build
booklore-api/.gradle
+20
View File
@@ -38,6 +38,26 @@ updates:
patterns:
- "*"
# Release tooling – npm (semantic-release)
- package-ecosystem: "npm"
directory: "/tools/release"
schedule:
interval: "weekly"
day: "friday"
time: "03:00"
timezone: "UTC"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "ci"
- "release"
commit-message:
prefix: "chore(deps)"
groups:
release-tooling:
patterns:
- "*"
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
+4 -2
View File
@@ -2,9 +2,11 @@
<!-- Why is this change needed? Explain in your own words. -->
> **Required for `develop` and `main`.** Your PR title must use Conventional Commit format because maintainers squash-merge with the PR title and stable releases are computed from commit history. Example: `fix(reader): prevent blank pages on chapter jump`
**Linked Issue:** Fixes #<!-- issue number -->
> **Required.** Every PR must reference an approved issue. If no issue exists, [open one](https://github.com/booklore-app/booklore/issues/new) and wait for maintainer approval before submitting a PR. Unsolicited PRs without a linked issue will be closed.
> **Required.** Every PR must reference an approved issue. If no issue exists, [open one](https://github.com/grimmory-tools/grimmory/issues/new) and wait for maintainer approval before submitting a PR. Unsolicited PRs without a linked issue will be closed.
## 🏷️ Type of Change
@@ -82,7 +84,7 @@ PASTE OUTPUT HERE
- [ ] PR is reasonably scoped (PRs over 1000+ changed lines will be closed, split into smaller PRs)
- [ ] No unsolicited refactors, cleanups, or "improvements" are bundled in
- [ ] Flyway migration versioning is correct _(if schema was modified)_
- [ ] Documentation PR submitted to [booklore-docs](https://github.com/booklore-app/booklore-docs) _(if user-facing changes)_
- [ ] Required documentation updates are included in this repo or the current Grimmory docs surface _(if user-facing changes)_
### 🤖 AI-Assisted Contributions
-72
View File
@@ -1,72 +0,0 @@
name-template: 'Release v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
categories:
- title: '🚀 New Features'
labels:
- 'feature'
- title: '✨ Enhancements'
labels:
- 'enhancement'
- title: '🎨 UI Tweaks'
labels:
- 'ui tweaks'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- 'fix'
- title: '⚡ Performance'
labels:
- 'performance'
- title: '🛠️ Refactoring & Maintenance'
labels:
- 'refactor'
- 'cleanup'
- 'chore'
- title: '📦 Dependencies'
labels:
- 'dependencies'
- 'dependency'
- 'deps'
- title: '⚙️ CI/CD'
labels:
- 'ci'
- 'cd'
- 'workflow'
- title: '📖 Documentation'
labels:
- 'docs'
- 'documentation'
- title: '🧪 Experimental'
labels:
- 'exploration'
- 'experimental'
exclude-labels:
- 'skip changelog'
change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
template: |
## 🌟 What's New in v$RESOLVED_VERSION
$CHANGES
## 🐳 Docker Images
- **Docker Hub:** `booklore/booklore:v$RESOLVED_VERSION`
- **GitHub Container Registry:** `ghcr.io/booklore-app/booklore:v$RESOLVED_VERSION`
**Full Changelog**: https://github.com/booklore-app/booklore/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
+60
View File
@@ -0,0 +1,60 @@
name: CI - Validate
on:
pull_request:
branches:
- develop
- main
push:
branches:
- develop
jobs:
migration-check:
name: Flyway Migration Check
if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }}
uses: ./.github/workflows/migrations-check.yml
with:
base_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
head_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
checkout_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
test-suite:
name: Test Suite
if: ${{ (github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]')) && (needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped') }}
needs: [migration-check]
uses: ./.github/workflows/test-suite.yml
with:
checkout_ref: ${{ github.sha }}
packaging-smoke-test:
name: Packaging Smoke Test
if: ${{ (github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]')) && needs.test-suite.result == 'success' }}
needs: [migration-check, test-suite]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set Up QEMU for Multi-Arch Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Build Runtime Image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: false
build-args: |
APP_VERSION=ci-${{ github.sha }}
APP_REVISION=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
-270
View File
@@ -1,270 +0,0 @@
name: Develop & PR – Build, Test, and Container Publish
on:
push:
branches:
- develop
pull_request:
branches:
- '**'
jobs:
migration-check:
name: Flyway Migration Check
uses: ./.github/workflows/migrations-check.yml
with:
base_ref: 'develop'
head_ref: 'HEAD'
backend-tests:
name: Backend Tests
needs: [ migration-check ]
if: needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Execute Backend Tests
id: backend_tests
working-directory: ./booklore-api
run: |
echo "Running backend tests..."
./gradlew test --no-daemon --parallel --build-cache
continue-on-error: true
- name: Publish Backend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-api/build/test-results/**/*.xml
check_name: Backend Test Results
- name: Upload Backend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: backend-test-reports
path: |
booklore-api/build/reports/tests/
booklore-api/build/test-results/
retention-days: 30
- name: Validate Backend Test Results
if: steps.backend_tests.outcome == 'failure'
run: |
echo "❌ Backend tests failed"
exit 1
frontend-tests:
name: Frontend Tests
needs: [ migration-check ]
if: needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: booklore-ui/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./booklore-ui
run: npm ci
- name: Audit Frontend Dependencies
working-directory: ./booklore-ui
run: npm audit --audit-level=high
- name: Validate Dependency Tree
working-directory: ./booklore-ui
run: npm ls --depth=0
- name: Execute Frontend Tests
id: frontend_tests
working-directory: ./booklore-ui
run: |
echo "Running frontend tests..."
npx ng test
continue-on-error: true
- name: Publish Frontend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-ui/test-results/vitest-results.xml
check_name: Frontend Test Results
- name: Upload Frontend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: frontend-test-reports
path: |
booklore-ui/test-results/vitest-results.xml
retention-days: 30
- name: Validate Frontend Test Results
if: steps.frontend_tests.outcome == 'failure'
run: |
echo "❌ Frontend tests failed"
exit 1
build-and-push:
name: Build and Push Container
needs: [ backend-tests, frontend-tests ]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
# ----------------------------------------
# Image tagging
# ----------------------------------------
- name: Generate Image Tag
id: set_image_tag
run: |
short_sha=$(git rev-parse --short HEAD)
if [ "${{ github.event_name }}" = "pull_request" ]; then
image_tag="pr-${{ github.event.pull_request.number }}-${short_sha}"
else
image_tag="develop-${short_sha}"
fi
echo "image_tag=$image_tag" >> $GITHUB_ENV
echo "Image tag: $image_tag"
# ----------------------------------------
# Native Angular build
# ----------------------------------------
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: booklore-ui/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./booklore-ui
run: npm ci
- name: Audit Frontend Dependencies
working-directory: ./booklore-ui
run: npm audit --audit-level=high
- name: Validate Dependency Tree
working-directory: ./booklore-ui
run: npm ls --depth=0
- name: Build Angular App
working-directory: ./booklore-ui
run: npx ng build --configuration=production
# ----------------------------------------
# Native Gradle build
# ----------------------------------------
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Copy Angular Dist to Spring Boot Resources
run: cp -r booklore-ui/dist/booklore/browser/. booklore-api/src/main/resources/static/
- name: Inject Version into application.yaml
env:
APP_VERSION: ${{ env.image_tag }}
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.52.2/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
yq eval '.app.version = strenv(APP_VERSION)' -i booklore-api/src/main/resources/application.yaml
- name: Build Spring Boot JAR
working-directory: ./booklore-api
run: ./gradlew clean build -x test --no-daemon --parallel --build-cache
# ----------------------------------------
# Environment setup
# ----------------------------------------
- name: Set Up QEMU for Multi-Arch Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
# ----------------------------------------
# Docker login (pushes & internal PRs only)
# ----------------------------------------
- name: Authenticate to Docker Hub
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Authenticate to GitHub Container Registry
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
# ----------------------------------------
# Docker build & push (push + internal PRs)
# ----------------------------------------
- name: Build and push Docker image
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile.ci
platforms: linux/amd64,linux/arm64
push: true
tags: |
booklore/booklore:${{ env.image_tag }}
ghcr.io/booklore-app/booklore:${{ env.image_tag }}
build-args: |
APP_VERSION=${{ env.image_tag }}
APP_REVISION=${{ github.sha }}
cache-from: |
type=gha
type=registry,ref=ghcr.io/booklore-app/booklore:buildcache
cache-to: |
type=gha,mode=max
type=registry,ref=ghcr.io/booklore-app/booklore:buildcache,mode=max
-335
View File
@@ -1,335 +0,0 @@
name: Master - Build, Tag, Push, and Release
on:
push:
branches:
- 'master'
jobs:
get-base-ref:
name: Get Base Ref
runs-on: ubuntu-latest
outputs:
base_ref: ${{ steps.get_base.outputs.base_ref }}
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- name: Get Base Ref
id: get_base
run: echo "base_ref=$(git rev-parse HEAD~1)" >> $GITHUB_OUTPUT
migration-check:
name: Flyway Migration Check on Master
needs: [ get-base-ref ]
uses: ./.github/workflows/migrations-check.yml
with:
base_ref: ${{ needs.get-base-ref.outputs.base_ref }}
head_ref: ${{ github.sha }}
backend-tests:
name: Backend Tests
needs: [ migration-check ]
if: needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Execute Backend Tests
id: backend_tests
working-directory: ./booklore-api
run: |
echo "Running backend tests..."
./gradlew test --no-daemon --parallel --build-cache
continue-on-error: true
- name: Publish Backend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-api/build/test-results/**/*.xml
check_name: Backend Test Results
- name: Upload Backend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: backend-test-reports
path: |
booklore-api/build/reports/tests/
booklore-api/build/test-results/
retention-days: 30
- name: Validate Backend Test Results
if: steps.backend_tests.outcome == 'failure'
run: |
echo "❌ Backend tests failed"
exit 1
frontend-tests:
name: Frontend Tests
needs: [ migration-check ]
if: needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: booklore-ui/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./booklore-ui
run: npm ci
- name: Audit Frontend Dependencies
working-directory: ./booklore-ui
run: npm audit --audit-level=high
- name: Validate Dependency Tree
working-directory: ./booklore-ui
run: npm ls --depth=0
- name: Execute Frontend Tests
id: frontend_tests
working-directory: ./booklore-ui
run: |
echo "Running frontend tests..."
npx ng test
continue-on-error: true
- name: Publish Frontend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-ui/test-results/vitest-results.xml
check_name: Frontend Test Results
- name: Upload Frontend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: frontend-test-reports
path: |
booklore-ui/test-results/vitest-results.xml
retention-days: 30
- name: Validate Frontend Test Results
if: steps.frontend_tests.outcome == 'failure'
run: |
echo "❌ Frontend tests failed"
exit 1
build-and-release:
needs: [ backend-tests, frontend-tests ]
if: needs.backend-tests.result == 'success' && needs.frontend-tests.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: read
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Authenticate to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Authenticate to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set Up QEMU for Multi-Architecture Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Retrieve Latest Master Version Tag
id: get_version
run: |
latest_tag=$(git tag --list "v*" --sort=-v:refname | head -n 1)
latest_tag=${latest_tag:-"v0.0.0"}
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
echo "Latest master tag: $latest_tag"
- name: Determine Version Bump
id: determine_bump
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "Determining version bump from PR labels..."
# Extract PR number from merge commit
pr_number=$(git log -1 --pretty=%B | grep -oE 'Merge pull request #[0-9]+' | grep -oE '[0-9]+') || true
if [ -z "$pr_number" ]; then
pr_number=$(gh pr list --state merged --base master --limit 1 --json number --jq '.[0].number')
fi
echo "PR number: $pr_number"
labels=$(gh pr view "$pr_number" --json labels --jq '.labels[].name' || echo "")
echo "PR labels: $labels"
if echo "$labels" | grep -q 'bump:major'; then
bump="major"
elif echo "$labels" | grep -q 'bump:minor'; then
bump="minor"
elif echo "$labels" | grep -q 'bump:patch'; then
bump="patch"
else
last_commit_msg=$(git log -1 --pretty=%B)
if echo "$last_commit_msg" | grep -iq '#major'; then
bump="major"
elif echo "$last_commit_msg" | grep -iq '#minor'; then
bump="minor"
elif echo "$last_commit_msg" | grep -iq '#patch'; then
bump="patch"
else
bump="patch"
fi
fi
# Calculate next version
semver=$(echo ${{ env.latest_tag }} | sed 's/^v//')
major=$(echo $semver | cut -d. -f1)
minor=$(echo $semver | cut -d. -f2)
patch=$(echo $semver | cut -d. -f3)
case "$bump" in
major) major=$((major+1)); minor=0; patch=0 ;;
minor) minor=$((minor+1)); patch=0 ;;
patch) patch=$((patch+1)) ;;
esac
next_version="v${major}.${minor}.${patch}"
echo "Version bump type: $bump"
echo "Next version: $next_version"
echo "bump=$bump" >> $GITHUB_ENV
echo "new_tag=$next_version" >> $GITHUB_ENV
# ----------------------------------------
# Native Angular build
# ----------------------------------------
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: booklore-ui/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./booklore-ui
run: npm ci
- name: Audit Frontend Dependencies
working-directory: ./booklore-ui
run: npm audit --audit-level=high
- name: Validate Dependency Tree
working-directory: ./booklore-ui
run: npm ls --depth=0
- name: Build Angular App
working-directory: ./booklore-ui
run: npx ng build --configuration=production
# ----------------------------------------
# Native Gradle build
# ----------------------------------------
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Copy Angular Dist to Spring Boot Resources
run: cp -r booklore-ui/dist/booklore/browser/. booklore-api/src/main/resources/static/
- name: Inject Version into application.yaml
env:
APP_VERSION: ${{ env.new_tag }}
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.52.2/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
yq eval '.app.version = strenv(APP_VERSION)' -i booklore-api/src/main/resources/application.yaml
- name: Build Spring Boot JAR
working-directory: ./booklore-api
run: ./gradlew clean build -x test --no-daemon --parallel --build-cache
# ----------------------------------------
# Docker build & push
# ----------------------------------------
- name: Build and push Docker image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile.ci
platforms: linux/amd64,linux/arm64
push: true
tags: |
booklore/booklore:${{ env.new_tag }}
booklore/booklore:latest
ghcr.io/booklore-app/booklore:${{ env.new_tag }}
ghcr.io/booklore-app/booklore:latest
build-args: |
APP_VERSION=${{ env.new_tag }}
APP_REVISION=${{ github.sha }}
cache-from: |
type=gha
type=registry,ref=ghcr.io/booklore-app/booklore:buildcache
cache-to: |
type=gha,mode=max
type=registry,ref=ghcr.io/booklore-app/booklore:buildcache,mode=max
- name: Update GitHub Release Draft
uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6
with:
tag: ${{ env.new_tag }}
name: "Release ${{ env.new_tag }}"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Publish GitHub Draft Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release edit ${{ env.new_tag }} --draft=true
+34 -13
View File
@@ -3,12 +3,16 @@ name: Reusable - Flyway Migration Check
on:
workflow_call:
inputs:
checkout_ref:
description: "The ref to check out before diffing migrations"
required: true
type: string
base_ref:
description: 'The base ref for comparison'
description: "The base ref for comparison"
required: true
type: string
head_ref:
description: 'The head ref for comparison'
description: "The head ref for comparison"
required: true
type: string
outputs:
@@ -21,28 +25,45 @@ jobs:
name: Check for DB Migrations
runs-on: ubuntu-latest
outputs:
base_ref: ${{ steps.normalize_refs.outputs.base_ref }}
head_ref: ${{ steps.normalize_refs.outputs.head_ref }}
has_migrations: ${{ steps.check_migrations.outputs.has_migrations }}
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref }}
- name: Normalize Diff Refs
id: normalize_refs
run: |
base_ref="${{ inputs.base_ref }}"
head_ref="${{ inputs.head_ref }}"
if [ "$base_ref" = "0000000000000000000000000000000000000000" ]; then
echo "base_ref is the all-zero sentinel; callers must supply a real comparison base for migration checks." >&2
exit 1
fi
echo "base_ref=$base_ref" >> "$GITHUB_OUTPUT"
echo "head_ref=$head_ref" >> "$GITHUB_OUTPUT"
- name: Detect Flyway Migration Changes
id: check_migrations
run: |
echo "Comparing ${{ inputs.base_ref }}...${{ inputs.head_ref }}"
if git diff --name-only ${{ inputs.base_ref }}...${{ inputs.head_ref }} | grep -q "booklore-api/src/main/resources/db/migration/V.*.sql"; then
echo "Comparing ${{ steps.normalize_refs.outputs.base_ref }}...${{ steps.normalize_refs.outputs.head_ref }}"
if git diff --name-only "${{ steps.normalize_refs.outputs.base_ref }}...${{ steps.normalize_refs.outputs.head_ref }}" | grep -Eq "^booklore-api/src/main/resources/db/migration/V.*\\.sql$"; then
echo "Migration file changes detected. Proceeding with migration preview."
echo "has_migrations=true" >> $GITHUB_OUTPUT
echo "has_migrations=true" >> "$GITHUB_OUTPUT"
else
echo "No migration file changes detected. Skipping migration preview."
echo "has_migrations=false" >> $GITHUB_OUTPUT
echo "has_migrations=false" >> "$GITHUB_OUTPUT"
fi
flyway-migration-preview:
name: Flyway DB Migration Preview
needs: [ check-for-migrations ]
needs: [check-for-migrations]
if: needs.check-for-migrations.outputs.has_migrations == 'true'
runs-on: ubuntu-latest
services:
@@ -63,15 +84,15 @@ jobs:
- name: Checkout Base Branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ inputs.base_ref }}
ref: ${{ needs.check-for-migrations.outputs.base_ref }}
fetch-depth: 0
- name: Apply Migrations from Base Branch
run: |
echo "Applying migrations from base ref (${{ inputs.base_ref }})..."
echo "Applying migrations from base ref (${{ needs.check-for-migrations.outputs.base_ref }})..."
docker run --network host \
-v ${{ github.workspace }}:/flyway/sql \
flyway/flyway:11.19.0-alpine \
flyway/flyway:12.1.0 \
-url=jdbc:mariadb://127.0.0.1:3306/booklore_test \
-user=root -password=root \
-locations=filesystem:/flyway/sql/booklore-api/src/main/resources/db/migration \
@@ -80,15 +101,15 @@ jobs:
- name: Checkout Head Branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ inputs.head_ref }}
ref: ${{ needs.check-for-migrations.outputs.head_ref }}
fetch-depth: 0
- name: Apply Migrations from Head Branch
run: |
echo "Applying new migrations from head ref (${{ inputs.head_ref }})..."
echo "Applying new migrations from head ref (${{ needs.check-for-migrations.outputs.head_ref }})..."
docker run --network host \
-v ${{ github.workspace }}:/flyway/sql \
flyway/flyway:11.19.0-alpine \
flyway/flyway:12.1.0 \
-url=jdbc:mariadb://127.0.0.1:3306/booklore_test \
-user=root -password=root \
-locations=filesystem:/flyway/sql/booklore-api/src/main/resources/db/migration \
+82
View File
@@ -0,0 +1,82 @@
name: Preview - Build Image
on:
workflow_dispatch:
inputs:
ref:
description: 'Git ref to preview build'
required: true
type: string
pr_number:
description: 'Optional PR number for a pr-<number>-<sha> tag'
required: false
default: ''
type: string
jobs:
build-and-push:
name: Build and Push Preview Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Generate Preview Tag
env:
PR_NUMBER: ${{ inputs.pr_number }}
run: |
short_sha=$(git rev-parse --short HEAD)
if [ -n "$PR_NUMBER" ]; then
case "$PR_NUMBER" in
(*[!0-9]*)
echo "Invalid PR number: $PR_NUMBER"
exit 1
;;
esac
preview_tag="pr-${PR_NUMBER}-${short_sha}"
else
preview_tag="preview-${short_sha}"
fi
echo "preview_tag=$preview_tag" >> "$GITHUB_ENV"
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
echo "Preview tag: $preview_tag"
- name: Set Up QEMU for Multi-Arch Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Authenticate to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Preview image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/grimmory-tools/grimmory:${{ env.preview_tag }}
build-args: |
APP_VERSION=${{ env.preview_tag }}
APP_REVISION=${{ env.commit_sha }}
cache-from: |
type=gha
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
cache-to: type=gha,mode=max
+99
View File
@@ -0,0 +1,99 @@
name: Nightly - Build and Publish
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
resolve_ref:
name: Resolve Nightly Ref
runs-on: ubuntu-latest
outputs:
commit_sha: ${{ steps.resolve.outputs.commit_sha }}
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: develop
- name: Record Resolved Commit
id: resolve
run: |
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
test-suite:
name: Test Suite
needs: [resolve_ref]
uses: ./.github/workflows/test-suite.yml
with:
checkout_ref: ${{ needs.resolve_ref.outputs.commit_sha }}
build-and-push:
name: Build and Push Nightly Image
needs: [resolve_ref, test-suite]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ needs.resolve_ref.outputs.commit_sha }}
- name: Generate Nightly Tag
run: |
short_sha=$(git rev-parse --short HEAD)
build_date=$(date -u +%Y%m%d)
nightly_tag="nightly-${build_date}-${short_sha}"
echo "nightly_tag=$nightly_tag" >> "$GITHUB_ENV"
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
echo "Nightly tag: $nightly_tag"
- name: Set Up QEMU for Multi-Arch Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Authenticate to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Authenticate to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Docker image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
grimmory/grimmory:${{ env.nightly_tag }}
grimmory/grimmory:nightly
ghcr.io/grimmory-tools/grimmory:${{ env.nightly_tag }}
ghcr.io/grimmory-tools/grimmory:nightly
build-args: |
APP_VERSION=${{ env.nightly_tag }}
APP_REVISION=${{ env.commit_sha }}
cache-from: |
type=gha
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
cache-to: |
type=gha,mode=max
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max
+76
View File
@@ -0,0 +1,76 @@
name: Release - Publish Stable Images
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
name: Build, Publish, and Finalize Stable Release
if: ${{ github.ref_name != 'v2.2.1' }}
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Record Release Tag and Commit
run: |
echo "release_tag=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
echo "Stable release tag: ${GITHUB_REF_NAME}"
- name: Set Up QEMU for Multi-Arch Builds
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Authenticate to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Authenticate to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push Stable image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
grimmory/grimmory:${{ env.release_tag }}
grimmory/grimmory:latest
ghcr.io/grimmory-tools/grimmory:${{ env.release_tag }}
ghcr.io/grimmory-tools/grimmory:latest
build-args: |
APP_VERSION=${{ env.release_tag }}
APP_REVISION=${{ env.commit_sha }}
cache-from: |
type=gha
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
cache-to: |
type=gha,mode=max
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max
- name: Publish Draft GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release edit "${{ env.release_tag }}" --draft=false
+72
View File
@@ -0,0 +1,72 @@
name: Release - Semantic Stable
on:
push:
branches:
- main
concurrency:
group: release-main
cancel-in-progress: false
jobs:
migration-check:
name: Flyway Migration Check
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
uses: ./.github/workflows/migrations-check.yml
with:
base_ref: ${{ github.event.before }}
head_ref: ${{ github.sha }}
checkout_ref: ${{ github.sha }}
test-suite:
name: Test Suite
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
needs: [migration-check]
uses: ./.github/workflows/test-suite.yml
with:
checkout_ref: ${{ github.sha }}
semantic-release:
name: Compute Release, Update Changelog, and Draft GitHub Release
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
needs: [migration-check, test-suite]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: tools/release/package-lock.json
- name: Install Release Tooling Dependencies
run: npm --prefix tools/release ci
- name: Configure Release Bot Git Identity
env:
RELEASE_GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${RELEASE_GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
run: npx --prefix tools/release semantic-release --extends ./tools/release/release.config.cjs
+59
View File
@@ -0,0 +1,59 @@
name: Release - Dry Run Preview
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref or commit to preview as the next stable release candidate'
required: false
default: main
type: string
jobs:
preview:
name: Preview Next Stable Release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Confirm Preview Ref Is Contained By Main
run: |
git fetch origin main --tags --force
if ! git merge-base --is-ancestor HEAD origin/main; then
echo "Selected ref is not contained by origin/main"
exit 1
fi
git checkout -B main "$(git rev-parse HEAD)"
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: tools/release/package-lock.json
- name: Install Release Tooling Dependencies
run: npm --prefix tools/release ci
- name: Run semantic-release Dry Run
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
run: |
npx --prefix tools/release semantic-release \
--dry-run \
--extends ./tools/release/release.config.cjs | tee semantic-release-preview.log
- name: Upload Preview Output
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: semantic-release-preview
path: semantic-release-preview.log
retention-days: 14
+32
View File
@@ -0,0 +1,32 @@
name: CI - Semantic PR Title
on:
pull_request:
branches:
- develop
- main
types:
- opened
- edited
- reopened
- synchronize
jobs:
validate-pr-title:
name: Validate PR Title
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check Conventional PR Title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
regex='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([A-Za-z0-9._/-]+\))?(!)?: .+$'
if ! printf '%s\n' "$PR_TITLE" | grep -Eq "$regex"; then
echo "PR titles for develop/main must use Conventional Commit format." >&2
echo "Example: refactor(release): adopt semantic-release for stable builds" >&2
exit 1
fi
+127
View File
@@ -0,0 +1,127 @@
name: Reusable - Test Suite
on:
workflow_call:
inputs:
checkout_ref:
description: 'The ref to check out before running tests'
required: true
type: string
jobs:
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref }}
- name: Set Up JDK 25
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle
- name: Execute Backend Tests
id: backend_tests
working-directory: ./booklore-api
run: |
echo "Running backend tests..."
./gradlew test --no-daemon --parallel --build-cache
continue-on-error: true
- name: Publish Backend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-api/build/test-results/**/*.xml
check_name: Backend Test Results
- name: Upload Backend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: backend-test-reports
path: |
booklore-api/build/reports/tests/
booklore-api/build/test-results/
retention-days: 30
- name: Validate Backend Test Results
if: steps.backend_tests.outcome == 'failure'
run: |
echo "❌ Backend tests failed"
exit 1
frontend-tests:
name: Frontend Tests
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref }}
- name: Set Up Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: booklore-ui/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./booklore-ui
run: npm ci
- name: Audit Frontend Dependencies
working-directory: ./booklore-ui
run: npm audit --audit-level=critical
- name: Validate Dependency Tree
working-directory: ./booklore-ui
run: npm ls --depth=0
- name: Execute Frontend Tests
id: frontend_tests
working-directory: ./booklore-ui
run: |
echo "Running frontend tests..."
npx ng test
continue-on-error: true
- name: Publish Frontend Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
if: always()
with:
files: booklore-ui/test-results/vitest-results.xml
check_name: Frontend Test Results
- name: Upload Frontend Test Reports
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: frontend-test-reports
path: |
booklore-ui/test-results/vitest-results.xml
retention-days: 30
- name: Validate Frontend Test Results
if: steps.frontend_tests.outcome == 'failure'
run: |
echo "❌ Frontend tests failed"
exit 1
+5
View File
@@ -0,0 +1,5 @@
# Changelog
All notable Grimmory releases are tracked here.
This file is maintained by semantic-release.
+33 -21
View File
@@ -1,10 +1,10 @@
# Contributing to Booklore
# Contributing to Grimmory
Thanks for your interest in contributing to Booklore! Whether you're fixing bugs, adding features, improving documentation, or asking questions, every contribution helps.
Thanks for your interest in contributing to Grimmory! Whether you're fixing bugs, adding features, improving documentation, or asking questions, every contribution helps.
## What is Booklore?
## What is Grimmory?
**Booklore** is a self-hostable digital library platform for managing and reading books and comics.
**Grimmory** is a self-hostable digital library platform for managing and reading books and comics. It is the community-maintained successor to Booklore.
**Tech Stack:**
@@ -34,7 +34,7 @@ Thanks for your interest in contributing to Booklore! Whether you're fixing bugs
## Before You Start
> **Issue first, PR second.** Every pull request must be linked to an approved issue. If you want to work on something, [open an issue](https://github.com/booklore-app/booklore/issues/new) (or find an existing one) and wait for a maintainer to approve it before writing code. PRs submitted without a linked, approved issue will be closed.
> **Issue first, PR second.** Every pull request must be linked to an approved issue. If you want to work on something, [open an issue](https://github.com/grimmory-tools/grimmory/issues/new) (or find an existing one) and wait for a maintainer to approve it before writing code. PRs submitted without a linked, approved issue will be closed.
This protects both your time and ours. It ensures that the work is actually wanted and that you're heading in the right direction before you invest effort.
@@ -50,8 +50,8 @@ This protects both your time and ours. It ensures that the work is actually want
Not sure where to begin? Look for issues labeled:
- [`good first issue`](https://github.com/booklore-app/booklore/labels/good%20first%20issue) - small, well-scoped tasks ideal for newcomers
- [`help wanted`](https://github.com/booklore-app/booklore/labels/help%20wanted) - tasks where maintainers would appreciate a hand
- [`good first issue`](https://github.com/grimmory-tools/grimmory/labels/good%20first%20issue) - small, well-scoped tasks ideal for newcomers
- [`help wanted`](https://github.com/grimmory-tools/grimmory/labels/help%20wanted) - tasks where maintainers would appreciate a hand
---
@@ -59,12 +59,12 @@ Not sure where to begin? Look for issues labeled:
### Fork and Clone
First, [fork the repository](https://github.com/booklore-app/booklore/fork) on GitHub, then clone your fork locally:
First, [fork the repository](https://github.com/grimmory-tools/grimmory/fork) on GitHub, then clone your fork locally:
```bash
git clone https://github.com/<your-username>/booklore.git
cd booklore
git remote add upstream https://github.com/booklore-app/booklore.git
git clone https://github.com/<your-username>/grimmory.git
cd grimmory
git remote add upstream https://github.com/grimmory-tools/grimmory.git
```
### Keep Your Fork in Sync
@@ -78,7 +78,7 @@ git merge upstream/develop
git push origin develop
```
> **Note:** All work should be based on the `develop` branch, not `main`.
> **Note:** Feature work targets `develop`. `main` is reserved for stable releases and release tags.
---
@@ -87,9 +87,11 @@ git push origin develop
### Project Structure
```
booklore/
grimmory/
├── booklore-ui/ # Angular frontend (TypeScript, PrimeNG)
├── booklore-api/ # Spring Boot backend (Java 25, Gradle)
├── deploy/ # Compose, Helm, and Podman deployment examples
├── packaging/docker/ # Container runtime assets used by the Docker build
├── dev.docker-compose.yml # Development Docker stack
├── assets/ # Shared assets (logos, icons)
└── local/ # Local development helpers
@@ -108,7 +110,7 @@ This starts:
| Service | URL / Port |
|------------|-----------------------|
| Frontend | http://localhost:4200 |
| Backend | http://localhost:8080 |
| Backend | http://localhost:6060 |
| MariaDB | localhost:3366 |
| Debug port | localhost:5005 |
@@ -247,6 +249,14 @@ feat(auth)!: migrate to OAuth 2.1
BREAKING CHANGE: OAuth 2.0 is no longer supported
```
PR titles targeting `develop` or `main` must use the same format. Feature work is squash-merged into `develop`, and stable releases are computed from the resulting commit history on `main`.
Release impact is derived from commit type:
- `feat` => minor release
- `fix`, `perf`, `refactor` => patch release
- `docs`, `ci`, `build`, `chore`, `test`, `style` => changelog-only unless paired with a release-triggering commit
### Workflow
1. Create a branch from `develop`
@@ -256,6 +266,8 @@ BREAKING CHANGE: OAuth 2.0 is no longer supported
5. Run the linter and fix any issues
6. Push to your fork and open a PR targeting `develop`
Maintainers promote cleaned `develop` history to `main` for stable releases. Do not expect a second squash step from `develop` to `main`; release automation depends on preserved conventional commit history.
---
## Submitting a Pull Request
@@ -274,7 +286,7 @@ Before opening your PR:
- [ ] PR contains a single logical change (one bug fix OR one feature)
- [ ] No unrelated refactors, style changes, or "improvements" are bundled in
- [ ] **PR is reasonably sized.** PRs with 1000+ changed lines will be closed without review. Break large changes into small, focused PRs.
- [ ] **For user-facing features:** submit a companion docs PR at [booklore-docs](https://github.com/booklore-app/booklore-docs)
- [ ] **For user-facing features:** include the required docs updates in this repo or in the active Grimmory docs surface
> When you open your PR on GitHub, a **PR template** will appear. Fill it out completely, including test output and screenshots.
@@ -326,13 +338,13 @@ We've seen a sharp increase in AI-generated PRs where the contributor clearly ne
## Reporting Bugs
1. **Search [existing issues](https://github.com/booklore-app/booklore/issues)** to avoid duplicates.
1. **Search [existing issues](https://github.com/grimmory-tools/grimmory/issues)** to avoid duplicates.
2. **Open a new issue** with the `bug` label including:
- Clear, descriptive title (e.g., "Book import fails with PDF files over 100MB")
- Steps to reproduce
- Expected vs. actual behavior
- Screenshots or error logs (if applicable)
- Environment details (OS, browser, Booklore version)
- Environment details (OS, browser, Grimmory version)
**Example:**
@@ -348,7 +360,7 @@ Steps to Reproduce:
Expected: Title should persist after refresh
Actual: Title reverts to original value
Environment: Chrome 120, macOS 14.2, Booklore 1.2.0
Environment: Chrome 120, macOS 14.2, Grimmory 1.2.0
```
---
@@ -356,7 +368,7 @@ Environment: Chrome 120, macOS 14.2, Booklore 1.2.0
## Community & Support
- **Discord:** [Join the server](https://discord.gg/Ee5hd458Uz) for questions and discussion
- **GitHub Issues:** [Report bugs or request features](https://github.com/booklore-app/booklore/issues)
- **GitHub Issues:** [Report bugs or request features](https://github.com/grimmory-tools/grimmory/issues)
---
@@ -381,8 +393,8 @@ Instances of unacceptable behavior may result in temporary or permanent ban from
## License
Booklore is licensed under the [AGPL-3.0 License](./LICENSE). By contributing, you agree that your contributions will be licensed under the same terms.
Grimmory is licensed under the [AGPL-3.0 License](./LICENSE). By contributing, you agree that your contributions will be licensed under the same terms.
---
Thank you for being part of the Booklore community!
Thank you for being part of the Grimmory community!
+42 -45
View File
@@ -1,74 +1,71 @@
# Stage 1: Build the Angular app
FROM node:24-alpine AS angular-build
FROM node:24-alpine AS frontend-build
WORKDIR /angular-app
WORKDIR /workspace/booklore-ui
COPY ./booklore-ui/package.json ./booklore-ui/package-lock.json ./
COPY booklore-ui/package.json booklore-ui/package-lock.json ./
RUN --mount=type=cache,target=/root/.npm \
npm config set registry https://registry.npmjs.org/ \
&& npm ci --force
COPY ./booklore-ui /angular-app/
npm ci --no-audit --no-fund
COPY booklore-ui/ ./
RUN npm run build --configuration=production
# Stage 2: Build the Spring Boot app with Gradle
FROM gradle:9.3.1-jdk25-alpine AS springboot-build
FROM gradle:9.3.1-jdk25-alpine AS backend-build
WORKDIR /springboot-app
WORKDIR /workspace/booklore-api
# Copy only build files first to cache dependencies
COPY ./booklore-api/build.gradle ./booklore-api/settings.gradle /springboot-app/
# Download dependencies (cached layer)
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle dependencies --no-daemon
COPY ./booklore-api/src /springboot-app/src
# Copy Angular dist into Spring Boot static resources so it's embedded in the JAR
COPY --from=angular-build /angular-app/dist/booklore/browser /springboot-app/src/main/resources/static
# Inject version into application.yaml using yq
ARG APP_VERSION
RUN apk add --no-cache yq && \
yq eval '.app.version = strenv(APP_VERSION)' -i /springboot-app/src/main/resources/application.yaml
COPY booklore-api/gradlew booklore-api/gradlew.bat booklore-api/build.gradle booklore-api/settings.gradle ./
COPY booklore-api/gradle ./gradle
RUN chmod +x ./gradlew
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle clean build -x test --no-daemon --parallel
./gradlew --no-daemon dependencies
COPY booklore-api/ ./
COPY --from=frontend-build /workspace/booklore-ui/dist/booklore/browser /tmp/frontend-dist
RUN mkdir -p build/resources/main/static && \
cp -r /tmp/frontend-dist/. build/resources/main/static/
RUN --mount=type=cache,target=/home/gradle/.gradle \
./gradlew --no-daemon bootJar
RUN set -eux; \
jar_path="$(find build/libs -maxdepth 1 -name '*.jar' ! -name '*plain.jar' | head -n 1)"; \
cp "$jar_path" /workspace/booklore-api/app.jar
FROM linuxserver/unrar:7.1.10 AS unrar-layer
# Stage 3: Final image
FROM eclipse-temurin:25-jre-alpine
ARG APP_VERSION
ARG APP_REVISION
ARG APP_VERSION=development
ARG APP_REVISION=unknown
# Set OCI labels
LABEL org.opencontainers.image.title="BookLore" \
org.opencontainers.image.description="BookLore: A self-hosted, multi-user digital library with smart shelves, auto metadata, Kobo & KOReader sync, BookDrop imports, OPDS support, and a built-in reader for EPUB, PDF, and comics." \
org.opencontainers.image.source="https://github.com/booklore-app/booklore" \
org.opencontainers.image.url="https://github.com/booklore-app/booklore" \
org.opencontainers.image.documentation="https://booklore.org/docs/getting-started" \
LABEL org.opencontainers.image.title="Grimmory" \
org.opencontainers.image.description="Grimmory: a self-hosted, multi-user digital library with smart shelves, auto metadata, Kobo and KOReader sync, BookDrop imports, OPDS support, and a built-in reader for EPUB, PDF, and comics." \
org.opencontainers.image.source="https://github.com/grimmory-tools/grimmory" \
org.opencontainers.image.url="https://github.com/grimmory-tools/grimmory" \
org.opencontainers.image.documentation="https://grimmory.org/docs/getting-started" \
org.opencontainers.image.version=$APP_VERSION \
org.opencontainers.image.revision=$APP_REVISION \
org.opencontainers.image.licenses="GPL-3.0" \
org.opencontainers.image.licenses="AGPL-3.0" \
org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine"
ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication -XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError"
ENV APP_VERSION=${APP_VERSION} \
APP_REVISION=${APP_REVISION}
ARG TARGETARCH
RUN apk update && apk add --no-cache su-exec libstdc++ libgcc && \
mkdir -p /bookdrop
COPY docker/unrar/unrar-${TARGETARCH} /usr/local/bin/unrar
RUN chmod 755 /usr/local/bin/unrar
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY packaging/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY --from=springboot-build /springboot-app/build/libs/booklore-api-0.0.1-SNAPSHOT.jar /app/app.jar
COPY --from=unrar-layer /usr/bin/unrar-alpine /usr/local/bin/unrar
COPY --from=backend-build /workspace/booklore-api/app.jar /app/app.jar
ARG BOOKLORE_PORT=6060
EXPOSE ${BOOKLORE_PORT}
ENTRYPOINT ["entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["java", "-jar", "/app/app.jar"]
-35
View File
@@ -1,35 +0,0 @@
# Runtime-only Dockerfile for CI builds.
# Expects the pre-built JAR at booklore-api/build/libs/booklore-api-0.0.1-SNAPSHOT.jar
# and entrypoint.sh in the build context.
FROM eclipse-temurin:25-jre-alpine
ARG APP_VERSION
ARG APP_REVISION
LABEL org.opencontainers.image.title="BookLore" \
org.opencontainers.image.description="BookLore: A self-hosted, multi-user digital library with smart shelves, auto metadata, Kobo & KOReader sync, BookDrop imports, OPDS support, and a built-in reader for EPUB, PDF, and comics." \
org.opencontainers.image.source="https://github.com/booklore-app/booklore" \
org.opencontainers.image.url="https://github.com/booklore-app/booklore" \
org.opencontainers.image.documentation="https://booklore.org/docs/getting-started" \
org.opencontainers.image.version=$APP_VERSION \
org.opencontainers.image.revision=$APP_REVISION \
org.opencontainers.image.licenses="GPL-3.0" \
org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine"
ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication -XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError"
ARG TARGETARCH
RUN apk update && apk add --no-cache su-exec libstdc++ libgcc
COPY docker/unrar/unrar-${TARGETARCH} /usr/local/bin/unrar
RUN chmod 755 /usr/local/bin/unrar
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY booklore-api/build/libs/booklore-api-0.0.1-SNAPSHOT.jar /app/app.jar
ARG BOOKLORE_PORT=6060
EXPOSE ${BOOKLORE_PORT}
ENTRYPOINT ["entrypoint.sh"]
CMD ["java", "-jar", "/app/app.jar"]
+21 -2
View File
@@ -86,13 +86,26 @@ MYSQL_DATABASE=grimmory
### Step 2: Docker Compose
Create a `docker-compose.yml`:
Stable images are published from semantic-release tags on `main` as `vX.Y.Z` plus `latest`. Nightly images are built from `develop` and tagged `nightly`.
> [!NOTE]
> Upgrading from an existing Booklore container? Keep your current service name, `container_name`, database name/user, ports, and mounted volumes exactly as they are and replace only the `image:` line with `grimmory/grimmory:<tag>` or `ghcr.io/grimmory-tools/grimmory:<tag>`.
```yaml
services:
booklore:
image: grimmory/grimmory:v2.2.1
```
Create a `docker-compose.yml` or copy and adapt [`deploy/compose/docker-compose.yml`](deploy/compose/docker-compose.yml):
```yaml
services:
grimmory:
image: grimmory/grimmory:latest
# Alternative: ghcr.io/grimmory-tools/grimmory:latest
# Convenience tag:
# image: grimmory/grimmory:<release-version>
# Alternative: ghcr.io/grimmory-tools/grimmory:<release-version>
# To build from source instead: comment out 'image' and uncomment below
# build: .
container_name: grimmory
@@ -149,6 +162,12 @@ docker compose up -d
Open http://localhost:6060, create your admin account, and start building your library.
Additional deployment examples:
- Docker Compose: [`deploy/compose/docker-compose.yml`](deploy/compose/docker-compose.yml)
- Helm: [`deploy/helm/grimmory/Chart.yaml`](deploy/helm/grimmory/Chart.yaml)
- Podman Quadlet: [`deploy/podman/quadlet/README.md`](deploy/podman/quadlet/README.md)
---
## BookDrop
@@ -21,12 +21,12 @@ public class VersionService {
@Value("${app.version:unknown}")
String appVersion;
private static final String GITHUB_REPO = "booklore-app/booklore";
private static final String GITHUB_REPO = "grimmory-tools/grimmory";
private static final String BASE_URI = "https://api.github.com/repos/" + GITHUB_REPO;
private static final int MAX_RELEASES = 15;
private static final RestClient REST_CLIENT = RestClient.builder()
.defaultHeader("Accept", "application/vnd.github+json")
.defaultHeader("User-Agent", "BookLore-Version-Checker")
.defaultHeader("User-Agent", "Grimmory-Version-Checker")
.build();
private static final ObjectMapper MAPPER = new ObjectMapper();
@@ -87,7 +87,7 @@ public class VersionService {
if (tag == null || !isVersionGreater(tag, currentVersion)) {
continue;
}
String url = "https://github.com/booklore-app/booklore" + "/releases/tag/" + tag;
String url = "https://github.com/grimmory-tools/grimmory" + "/releases/tag/" + tag;
LocalDateTime published = LocalDateTime.parse(release.path("published_at").asText(), DateTimeFormatter.ISO_DATE_TIME);
updates.add(new ReleaseNote(tag, release.path("name").asText(tag), release.path("body").asText(""), url, published));
}
@@ -116,4 +116,4 @@ public class VersionService {
}
return false;
}
}
}
@@ -1,7 +1,7 @@
app:
path-config: '/app/data'
bookdrop-folder: '/bookdrop'
version: 'development'
version: ${APP_VERSION:development}
cors:
# Comma-separated list of allowed CORS origins.
@@ -99,4 +99,4 @@ logging:
org.quartz.simpl.SimpleThreadPool: WARN
org.quartz.simpl.RAMJobStore: WARN
org.hibernate.orm.connections.pooling: WARN
org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer: ERROR
org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer: ERROR
@@ -24,7 +24,7 @@
</p>
<div class="support-cards">
<a class="support-card star-card" href="https://github.com/booklore-app/booklore" target="_blank" rel="noopener noreferrer">
<a class="support-card star-card" href="https://github.com/grimmory-tools/grimmory" target="_blank" rel="noopener noreferrer">
<i class="pi pi-github card-icon"></i>
<div class="card-text">
<span class="card-title">{{ t('starTitle') }}</span>
@@ -252,8 +252,8 @@ export class AppMenuComponent implements OnInit {
getVersionUrl(version: string | undefined): string {
if (!version) return '#';
return version.startsWith('v')
? `https://github.com/booklore-app/booklore/releases/tag/${version}`
: `https://github.com/booklore-app/booklore/commit/${version}`;
? `https://github.com/grimmory-tools/grimmory/releases/tag/${version}`
: `https://github.com/grimmory-tools/grimmory/commit/${version}`;
}
isSemanticVersion(version: string | undefined): boolean {
+60
View File
@@ -0,0 +1,60 @@
services:
# Upgrade path from Booklore:
# Keep your existing service name, container_name, database names/users, ports,
# and mounted volumes. Replace only the image line(s) with Grimmory tags.
grimmory:
# Stable release example:
image: grimmory/grimmory:v0.38.2
# Convenience tag:
# image: grimmory/grimmory:latest
# Or the GHCR image:
# image: ghcr.io/grimmory-tools/grimmory:v0.38.2
# The image already embeds its own release version metadata.
container_name: grimmory
environment:
- USER_ID=1000
- GROUP_ID=1000
- TZ=Etc/UTC
- DATABASE_URL=jdbc:mariadb://mariadb:3306/grimmory
- DATABASE_USERNAME=grimmory
- DATABASE_PASSWORD=your_secure_password
- SWAGGER_ENABLED=false
- FORCE_DISABLE_OIDC=false
# ALLOWED_ORIGINS=
# JAVA_TOOL_OPTIONS=-XX:+UseSerialGC -Xmx256m -XX:+UseCompactObjectHeaders -XX:+ExitOnOutOfMemoryError
depends_on:
mariadb:
condition: service_healthy
ports:
- "6060:6060"
volumes:
- ./data:/app/data
- ./books:/books
- ./bookdrop:/bookdrop
healthcheck:
test: wget -q -O - http://localhost:6060/api/v1/healthcheck
interval: 60s
retries: 5
start_period: 60s
timeout: 10s
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:11.4.8
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- MYSQL_ROOT_PASSWORD=super_secure_password
- MYSQL_DATABASE=grimmory
- MYSQL_USER=grimmory
- MYSQL_PASSWORD=your_secure_password
volumes:
- ./config:/config
restart: unless-stopped
healthcheck:
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ]
interval: 5s
timeout: 5s
retries: 10
@@ -1,7 +1,6 @@
apiVersion: v2
name: booklore
description: A Helm chart for [Booklore](https://github.com/booklore-app/booklore)
name: grimmory
description: A Helm chart for [Grimmory](https://github.com/grimmory-tools/grimmory)
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
@@ -11,18 +10,15 @@ description: A Helm chart for [Booklore](https://github.com/booklore-app/booklor
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.38.2"
appVersion: "v0.38.2"
dependencies:
- name: mariadb
version: 22.0.*
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "booklore.name" -}}
{{- define "grimmory.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "booklore.fullname" -}}
{{- define "grimmory.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "booklore.chart" -}}
{{- define "grimmory.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "booklore.labels" -}}
helm.sh/chart: {{ include "booklore.chart" . }}
{{ include "booklore.selectorLabels" . }}
{{- define "grimmory.labels" -}}
helm.sh/chart: {{ include "grimmory.chart" . }}
{{ include "grimmory.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "booklore.selectorLabels" -}}
app.kubernetes.io/name: {{ include "booklore.name" . }}
{{- define "grimmory.selectorLabels" -}}
app.kubernetes.io/name: {{ include "grimmory.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "booklore.serviceAccountName" -}}
{{- define "grimmory.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "booklore.fullname" .) .Values.serviceAccount.name }}
{{- default (include "grimmory.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
@@ -1,13 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "booklore.fullname" . }}
name: {{ include "grimmory.fullname" . }}
labels:
{{- include "booklore.labels" . | nindent 4 }}
{{- include "grimmory.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "booklore.selectorLabels" . | nindent 6 }}
{{- include "grimmory.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
@@ -15,7 +15,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "booklore.labels" . | nindent 8 }}
{{- include "grimmory.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -24,7 +24,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "booklore.serviceAccountName" . }}
serviceAccountName: {{ include "grimmory.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
@@ -109,7 +109,7 @@ spec:
claimName: {{ if .Values.persistence.dataVolume.existingClaim }}
{{- .Values.persistence.dataVolume.existingClaim }}
{{ else }}
{{- include "booklore.fullname" . }}-data
{{- include "grimmory.fullname" . }}-data
{{- end }}
{{- end }}
{{- if .Values.persistence.booksVolume.enabled }}
@@ -118,7 +118,7 @@ spec:
claimName: {{ if .Values.persistence.booksVolume.existingClaim }}
{{- .Values.persistence.booksVolume.existingClaim }}
{{ else }}
{{- include "booklore.fullname" . }}-books
{{- include "grimmory.fullname" . }}-books
{{- end }}
{{- end }}
{{- with .Values.extraVolumes }}
@@ -2,9 +2,9 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "booklore.fullname" . }}
name: {{ include "grimmory.fullname" . }}
labels:
{{- include "booklore.labels" . | nindent 4 }}
{{- include "grimmory.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
@@ -35,7 +35,7 @@ spec:
{{- end }}
backend:
service:
name: {{ include "booklore.fullname" $ }}
name: {{ include "grimmory.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
@@ -5,8 +5,8 @@ metadata:
annotations:
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/name: {{ include "booklore.fullname" . }}
name: {{ include "booklore.fullname" . }}-data
app.kubernetes.io/name: {{ include "grimmory.fullname" . }}
name: {{ include "grimmory.fullname" . }}-data
spec:
accessModes:
- ReadWriteOnce
@@ -22,8 +22,8 @@ metadata:
annotations:
helm.sh/resource-policy: keep
labels:
app.kubernetes.io/name: {{ include "booklore.fullname" . }}
name: {{ include "booklore.fullname" . }}-books
app.kubernetes.io/name: {{ include "grimmory.fullname" . }}
name: {{ include "grimmory.fullname" . }}-books
spec:
accessModes:
- ReadWriteOnce
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "booklore.fullname" . }}
name: {{ include "grimmory.fullname" . }}
labels:
{{- include "booklore.labels" . | nindent 4 }}
{{- include "grimmory.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
@@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "booklore.selectorLabels" . | nindent 4 }}
{{- include "grimmory.selectorLabels" . | nindent 4 }}
@@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "booklore.serviceAccountName" . }}
name: {{ include "grimmory.serviceAccountName" . }}
labels:
{{- include "booklore.labels" . | nindent 4 }}
{{- include "grimmory.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
@@ -1,4 +1,4 @@
# Default values for booklore.
# Default values for grimmory.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
@@ -7,23 +7,20 @@ mariadb:
image:
tag: 11.8.3
auth:
database: booklore
username: booklore-user
database: grimmory
username: grimmory
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
repository: booklore/booklore
repository: grimmory/grimmory
# This sets the pull policy for images.
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: latest
tag: ""
# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []
# This is to override the chart name.
nameOverride: ""
fullnameOverride: ""
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount:
# Specifies whether a service account should be created
@@ -35,24 +32,22 @@ serviceAccount:
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
# This is for setting Kubernetes Annotations to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podAnnotations: {}
# This is for setting Kubernetes Labels to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podLabels: {}
podSecurityContext: {}
# fsGroup: 2000
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
service:
@@ -60,14 +55,13 @@ service:
type: ClusterIP
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
port: 6060
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
@@ -77,18 +71,17 @@ ingress:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# # This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
@@ -97,7 +90,6 @@ livenessProbe:
readinessProbe:
tcpSocket:
port: http
# If you want to bring your own persistence (such as a hostPath),
# disable these and do so in extraVolumes/extraVolumeMounts
persistence:
@@ -109,13 +101,8 @@ persistence:
enabled: true
size: 10Gi
existingClaim: ""
extraVolumes: []
extraVolumeMounts: []
nodeSelector: {}
tolerations: []
affinity: {}
@@ -1,19 +1,20 @@
# Podman Example
This directory contains an example of how to use a rootless Podman pod defined through Quadlets to run booklore.
This directory contains an example of how to use a rootless Podman pod defined through Quadlets to run Grimmory.
# Setup
1. Copy the files in this directory to a suitable location on your system.
- For many systems Quadlet monitors `~/.config/containers/systemd`
- `mkdir -p ~/.config/containers/systemd && cp ./*lore* ~/.config/containers/systemd/`
2. Edit the `booklore.container` to set the correct mounts for `bookdrop` and your library
- `mkdir -p ~/.config/containers/systemd && cp ./*grimmory* ~/.config/containers/systemd/`
2. Edit the `grimmory.container` to set the correct mounts for `bookdrop` and your library
3. Create the Podman Secrets for the database
```bash
echo -n "YOUR PASSWORD" | podman secret create booklore_db_pass -
echo -n "YOUR PASSWORD" | podman secret create grimmory_db_pass -
```
4. (Optional) `podman pull ghcr.io/booklore-app/booklore:latest` to pre-pull the image
4. (Optional) `podman pull ghcr.io/grimmory-tools/grimmory:v0.38.2` to pre-pull the image
* If you have a slow connection, this is recommended because systemd will time out if the image pull takes too long.
* To follow rolling releases instead, set the image tag to `latest` in `grimmory.container`.
5. Run `systemctl --user daemon-reload` to pick up the new Quadlet unit.
6. Start the pod with `systemctl --user start booklore-pod.service`
6. Start the pod with `systemctl --user start grimmory-pod.service`
# Autoupdates
If automatic updates are desired, enable the systemd timer:
@@ -24,9 +25,9 @@ systemctl --user enable podman-auto-update.timer
This is a native way to schedule `podman auto-update` to run periodically and update/restart containers with `AutoUpdate` enabled in their Quadlet files.
# Verification Commands
- `systemctl --user status booklore-pod -l` - Check the status of the pod
- `systemctl --user status booklore-db -l` - Check the status of the database
- `systemctl --user status booklore -l` - Check the status of the booklore container
- `systemctl --user status grimmory-pod -l` - Check the status of the pod
- `systemctl --user status grimmory-db -l` - Check the status of the database
- `systemctl --user status grimmory -l` - Check the status of the Grimmory container
# Further Reading
@@ -0,0 +1,2 @@
[Volume]
VolumeName=grimmory-data
@@ -0,0 +1,21 @@
[Unit]
Description=Grimmory Database Container Using MariaDB
[Container]
ContainerName=grimmory-db
Image=lscr.io/linuxserver/mariadb:11.4.8
Pod=grimmory.pod
Pull=always
Volume=grimmory-db:/config
Environment=TZ=Etc/UTC
Environment=PUID=0
Environment=PGID=0
Environment=MYSQL_USER=grimmory
Secret=grimmory_db_pass,type=env,target=MYSQL_ROOT_PASSWORD
Secret=grimmory_db_pass,type=env,target=MYSQL_PASSWORD
Environment=MYSQL_DATABASE=grimmory
DropCapability=all
AddCapability=CAP_CHOWN CAP_SETUID CAP_SETGID CAP_FOWNER
+2
View File
@@ -0,0 +1,2 @@
[Volume]
VolumeName=grimmory-db
+30
View File
@@ -0,0 +1,30 @@
[Unit]
Description=Grimmory container
Requires=grimmory-db.container
After=grimmory-db.container
[Container]
ContainerName=grimmory
Image=ghcr.io/grimmory-tools/grimmory:v0.38.2
Pod=grimmory.pod
AutoUpdate=registry
Pull=always
Volume=grimmory-data:/app/data
# note the :z is important for selinux systems
# Volume=YOUR MOUNTS:/books:z
# Volume=YOUR MOUNTS:/bookdrop:z
Environment=TZ=Etc/UTC
Secret=grimmory_db_pass,type=env,target=DATABASE_PASSWORD
Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/grimmory
Environment=DATABASE_USERNAME=grimmory
HealthCmd=wget -q -O - http://localhost:6060/api/v1/healthcheck
HealthInterval=1m
HealthRetries=5
HealthStartPeriod=1m
HealthTimeout=10s
[Install]
WantedBy=default.target
@@ -1,7 +1,7 @@
[Unit]
Description=BookLore Pod
Description=Grimmory Pod
After=network-online.target
[Pod]
PodName=booklore
PodName=grimmory
PublishPort=6060:6060
Binary file not shown.
Binary file not shown.
+13 -13
View File
@@ -1,10 +1,10 @@
# Komga API Support
Booklore provides a Komga-compatible API that allows you to use Komga clients (like Tachiyomi, Tachidesk, Komelia, etc.) to access your Booklore library.
Grimmory provides a Komga-compatible API that allows you to use Komga clients (like Tachiyomi, Tachidesk, Komelia, etc.) to access your Grimmory library.
## Features
The Komga API implementation in Booklore provides the following endpoints:
The Komga API implementation in Grimmory provides the following endpoints:
### Libraries
- `GET /api/v1/libraries` - List all libraries
@@ -29,16 +29,16 @@ The Komga API implementation in Booklore provides the following endpoints:
## Data Model Mapping
Booklore organizes books differently than Komga:
Grimmory organizes books differently than Komga:
- **Komga**: Libraries → Series → Books
- **Booklore**: Libraries → Books (with optional series metadata)
- **Grimmory**: Libraries → Books (with optional series metadata)
The Komga API layer automatically creates virtual "series" by grouping books with the same series name in their metadata. Books without a series name are grouped under "Unknown Series".
## Enabling the Komga API
1. Navigate to **Settings** in Booklore
1. Navigate to **Settings** in Grimmory
2. Find the **Komga API** section
3. Toggle **Enable Komga API** to ON
4. Click **Save**
@@ -47,7 +47,7 @@ The Komga API layer automatically creates virtual "series" by grouping books wit
The Komga API uses the same OPDS user accounts for authentication. To access the Komga API:
1. Create an OPDS user account in Booklore settings
1. Create an OPDS user account in Grimmory settings
2. Use those credentials when configuring your Komga client
Authentication uses HTTP Basic Auth, the same as OPDS.
@@ -59,7 +59,7 @@ Authentication uses HTTP Basic Auth, the same as OPDS.
1. Install the Tachiyomi app
2. Add a source → Browse → Sources → Komga
3. Configure the source:
- Server URL: `http://your-booklore-server/`
- Server URL: `http://your-grimmory-server/`
- Username: Your OPDS username
- Password: Your OPDS password
@@ -67,7 +67,7 @@ Authentication uses HTTP Basic Auth, the same as OPDS.
1. Install Komelia
2. Add a server:
- URL: `http://your-booklore-server/`
- URL: `http://your-grimmory-server/`
- Username: Your OPDS username
- Password: Your OPDS password
@@ -76,21 +76,21 @@ Authentication uses HTTP Basic Auth, the same as OPDS.
1. Install Tachidesk
2. Add Komga extension
3. Configure:
- Server URL: `http://your-booklore-server/`
- Server URL: `http://your-grimmory-server/`
- Username: Your OPDS username
- Password: Your OPDS password
## Limitations
- Individual page extraction is not yet implemented; page requests return the book cover
- Read progress tracking from Komga clients is not synchronized with Booklore
- Read progress tracking from Komga clients is not synchronized with Grimmory
- Not all Komga API endpoints are implemented (only the most commonly used ones)
## Troubleshooting
### Cannot connect to server
- Ensure the Komga API is enabled in Booklore settings
- Ensure the Komga API is enabled in Grimmory settings
- Verify your OPDS credentials are correct
- Check that your server is accessible from the client device
@@ -101,12 +101,12 @@ Authentication uses HTTP Basic Auth, the same as OPDS.
### Authentication failures
- The Komga API uses OPDS user accounts, not your main Booklore account
- The Komga API uses OPDS user accounts, not your main Grimmory account
- Create an OPDS user in the Settings → OPDS section
- Use those credentials in your Komga client
## API Compatibility
The Booklore Komga API aims to be compatible with Komga v1.x API. While not all endpoints are implemented, the core functionality needed for reading and browsing is supported.
The Grimmory Komga API aims to be compatible with Komga v1.x API. While not all endpoints are implemented, the core functionality needed for reading and browsing is supported.
For the complete Komga API specification, see: https://github.com/gotson/komga
+6 -6
View File
@@ -26,22 +26,22 @@ Before setting up the OIDC client, ensure that Pocket ID is installed and runnin
### Step 2: Add a client
Once you have logged in and configured a PassKey you now need to create an OIDC client, this will let Pocket ID know about the application that needs to be configured, and will give you the relevant keys to add to the BookLore settings dialogue
Once you have logged in and configured a PassKey you now need to create an OIDC client, this will let Pocket ID know about the application that needs to be configured, and will give you the relevant keys to add to the Grimmory settings dialogue
- Login to PocketID
- Go to OIDC Clients on the left side bar
- Click Add OIDC Client
- Name: BookLore [Can be anything you want]
- Name: Grimmory [Can be anything you want]
- Callback URLs: `https://{host}/oauth2-callback`
- Tick Public & PKCE (This is required for BookLore to correctly authenticate with the client)
- Tick Public & PKCE (This is required for Grimmory to correctly authenticate with the client)
- Copy your Client ID to use later.
- Click show more details and copy the Certificate URL to use later
- Click Save
### Step 3: Configure BookLore OIDC Settings
### Step 3: Configure Grimmory OIDC Settings
To enable OIDC authentication in BookLore, you need to set the following within the application:
To enable OIDC authentication in Grimmory, you need to set the following within the application:
- Navigate to the settings cog at the top of the page
- Provider name - PocketID
@@ -53,4 +53,4 @@ To enable OIDC authentication in BookLore, you need to set the following within
### Step 4: Test the Integration
Once configured, simply click Save Settings and then click the Enabled radio button to activate it. Simply log out and log back in and you should be working with no issues! Any issues please raise an issue on the [Github](https://github.com/booklore-app/booklore/issues/new?template=bug_report.yml)
Once configured, simply click Save Settings and then click the Enabled radio button to activate it. Simply log out and log back in and you should be working with no issues! Any issues please raise an issue on [GitHub](https://github.com/grimmory-tools/grimmory/issues/new?template=bug_report.yml)
+7 -7
View File
@@ -1,14 +1,14 @@
# Forward Auth with Reverse Proxy
BookLore supports **Forward Auth**, allowing you to specify when a user is logged in using a reverse proxy and existing SSO provider.
Grimmory supports **Forward Auth**, allowing you to specify when a user is logged in using a reverse proxy and existing SSO provider.
## ⚠️ Security
** Important**: Enabling forward auth means BookLore will **fully trust headers sent by the reverse proxy**. Never expose BookLore directly to the internet when using forward auth - always route through your authenticated proxy, otherwise outsiders can attempt to impersonate any username they know about.
**Important**: Enabling forward auth means Grimmory will **fully trust headers sent by the reverse proxy**. Never expose Grimmory directly to the internet when using forward auth - always route through your authenticated proxy, otherwise outsiders can attempt to impersonate any username they know about.
## Configuration
Provide BookLore with the following environment variables:
Provide Grimmory with the following environment variables:
```bash
# Allows Forward Auth
@@ -36,8 +36,8 @@ REMOTE_AUTH_GROUPS_DELIMITER=\\s+ # Regex pattern for splitting groups.
```yaml
services:
booklore:
image: ghcr.io/adityachandelgit/booklore-app:latest
grimmory:
image: ghcr.io/grimmory-tools/grimmory:v0.38.2
environment:
# Forward Auth Configuration
- REMOTE_AUTH_ENABLED=true
@@ -53,7 +53,7 @@ services:
## Setting Up Defaults Permissions
1. **Access Admin Settings**: Log in to Booklore as an admin user
1. **Access Admin Settings**: Log in to Grimmory as an admin user
2. **Navigate to Authentication Settings**: Go to Settings → Authentication
3. **Configure OIDC Auto-Provision** (even if not using OIDC):
- Enable "Auto User Provisioning". You might need to enter a bogus URL to enable it temporarily.
@@ -69,6 +69,6 @@ books.example.com {
copy_headers Remote-User Remote-Name Remote-Email Remote-Groups
}
reverse_proxy booklore:6060
reverse_proxy grimmory:6060
}
```
+47
View File
@@ -0,0 +1,47 @@
# Grimmory CI/CD Rebrand and Release Refactor
## Summary
- Before changing any build flow, cut one archival pre-migration release from the current state, record image digests and release metadata, and tag that commit with a non-semver marker such as `pre-grimmory-buildflow` so the current Booklore-era artifact remains recoverable.
- Execute the implementation in three parallel workstreams with disjoint ownership: workflow/release automation under `.github/workflows`, Docker packaging and asset layout under `Dockerfile`, `packaging/docker`, and `.dockerignore`, and deploy/docs surfaces under `deploy/` plus the operational docs/templates.
- The target operating model is: automatic validation on PRs and pushes, automatic nightly publication from `develop`, manual GHCR preview builds for PR refs, and maintainer-run batch stable releases from `main`.
## Key Changes
- Replace the current `develop` + stable-release publish model with four explicit workflows:
- `ci-validate.yml`: runs on PRs to `develop` and `main`, plus pushes to `develop` and `main`; runs migration diff/preview, backend tests, frontend tests, and a no-push packaging smoke build.
- `publish-nightly.yml`: runs on `schedule` and `workflow_dispatch`, explicitly checks out `develop`, and publishes `nightly` plus `nightly-YYYYMMDD-<sha>` to Docker Hub and GHCR.
- `publish-release.yml`: runs only on `workflow_dispatch`, accepts `ref` and `bump` (`major|minor|patch`), verifies the chosen ref is on `main`, creates and pushes `vX.Y.Z`, publishes `vX.Y.Z` and `latest` to both registries, and publishes the GitHub release.
- `preview-image.yml`: runs only on `workflow_dispatch`, accepts a PR ref or arbitrary ref, and publishes a GHCR-only preview tag such as `pr-<number>-<sha>` or `preview-<sha>`.
- Keep the reusable migration-check workflow, but make every caller pass explicit `base_ref`, `head_ref`, and `checkout_ref`; remove hard-coded `develop`, `HEAD`, and `HEAD~1` logic so PRs, push validations, nightly, and release workflows all diff the correct commits.
- Use the manual release workflow, not PR labels, as the source of truth for `major`/`minor`/`patch`. `release-drafter` stays only as a changelog formatter; it must no longer decide version bumps, and its repo/image links must be updated to Grimmory.
- Rename only build/release/deploy surfaces from Booklore to Grimmory in this pass: registry targets, OCI labels, GitHub release links and notes, deploy examples, operational docs, contributor guidance, and release/helper scripts. Do not rename `booklore-api`, `booklore-ui`, Java package names, DB identifiers, migration paths, dist paths, or other app/runtime internals yet.
- Replace all remaining stable-branch references with `main`, while keeping `develop` as the integration branch. Update contributor docs to state that PRs land on `develop`, maintainers promote selected changes to `main`, and stable releases are cut manually from `main`.
- Converge on a single canonical root `Dockerfile` and delete `Dockerfile.ci`. The Dockerfile should be a normal multi-stage source build that produces one minimal runtime image; CI should stop doing native workspace mutations like copying frontend build output into tracked resources or editing tracked `application.yaml` before packaging.
- Move packaging assets under `packaging/docker/`, keep the public build entrypoint as the root `Dockerfile`, and move deploy examples into a clear `deploy/` tree: `deploy/compose`, `deploy/helm/grimmory`, and `deploy/podman/quadlet`. Split scripts by purpose under `scripts/release` and `scripts/i18n` or `scripts/ops`.
- Tighten `.dockerignore` so docs, deploy examples, plans, and unrelated tooling do not bloat the Docker build context.
- Standardize tag policy and example usage:
- Stable: `vX.Y.Z` and `latest`.
- Nightly: `nightly` and `nightly-YYYYMMDD-<sha>`.
- Preview: GHCR-only, never `latest`, never Docker Hub.
- Stable deployment examples and README snippets should show pinned semver first, with `latest` documented as a convenience tag.
## Test Plan
- PR validation to `develop` and `main` runs automatically, publishes no images, and uses the correct migration diff base/head.
- Push validation on `develop` and `main` runs automatically and produces no registry side effects.
- Scheduled nightly runs from `develop` even though GitHub schedules execute from the default branch context, and it publishes only the nightly tags.
- Manual preview build for a PR ref publishes only to GHCR and never mutates stable/nightly tags.
- Manual stable release from a selected `main` commit creates and pushes the git tag, publishes semver plus `latest` to both registries, and publishes a GitHub release using Grimmory links and image names.
- Local `docker build .` and CI image publication both use the same Dockerfile and produce the same runtime image layout.
- The packaging path leaves tracked files untouched; no workflow step edits repo-tracked source files as part of building an image.
- Deploy examples, release metadata, OCI labels, and contributor docs all consistently use Grimmory registry names and `main`/`develop` semantics.
## Assumptions and Defaults
- `main` is the default branch and the only stable release source.
- `develop` remains the integration branch and the source for nightly images.
- Stable releases are intentionally batch-based and maintainer-triggered; merging to `main` does not automatically publish a release.
- GHCR preview images are sufficient for PR testing; Docker Hub preview publication is out of scope.
- The canonical registry targets are `grimmory/grimmory` and `ghcr.io/grimmory-tools/grimmory`.
- This pass is intentionally limited to build, release, deploy, and operational surfaces so the existing application internals remain intact while the delivery system is rebranded and stabilized.
+49
View File
@@ -0,0 +1,49 @@
# Semantic-Release Migration for Stable Releases
## Summary
Step 0: write this plan to `docs/plans/semantic-release-migration.md`.
Replace Release Drafter and the manual bump-based stable release flow with `semantic-release` as the single source of truth for stable versioning and release notes. Stable releases are computed automatically from conventional commit history on `main`, nightly builds remain on `develop`, and the first semantic-release-managed stable release must be `v2.2.2`.
## Key Changes
- Add dedicated release tooling under `tools/release/` with its own `package.json`, lockfile, and `release.config.cjs`.
- Remove Release Drafter and the manual stable bump workflow.
- Introduce a push-to-`main` semantic-release workflow that:
- runs migration checks and the shared test suite,
- updates `CHANGELOG.md`,
- creates the release commit and `vX.Y.Z` tag,
- and opens a draft GitHub release with grouped notes.
- Introduce a tag-driven stable image workflow on `v*` tags that publishes Docker Hub and GHCR images and finalizes the matching draft GitHub release.
- Keep nightly publication on `develop` and manual preview image builds unchanged.
- Enforce semantic PR titles on PRs targeting `develop` and `main`.
- Treat release bumps as:
- `BREAKING CHANGE` => major
- `feat` => minor
- `fix`, `perf`, `refactor` => patch
- `docs`, `ci`, `build`, `chore`, `test`, `style` => notes only
- Group release notes and `CHANGELOG.md` sections by type, including non-triggering categories.
## Bootstrap
- Seed the release history with an annotated `v2.2.1` tag on commit `384512534fe5a2f42d8482a0646337e28ef54e52`.
- Push the seed tag only. Do not create a public historical GitHub release for `v2.2.1`.
- Merge the semantic-release migration as a patch-triggering commit so the first semantic-release-managed stable release becomes `v2.2.2`.
## Test Plan
- Verify semantic-release dry run computes `2.2.2` from the seeded history.
- Verify `feat`, `fix`, `perf`, `refactor`, and breaking-change behavior matches the configured release rules.
- Verify `docs`, `ci`, `build`, `chore`, `test`, and `style` appear in notes but do not trigger releases by themselves.
- Verify semantic PR title linting blocks invalid squash-merge titles.
- Verify the stable semantic-release workflow skips `[skip ci]` release commits and does not loop.
- Verify the tag-driven image workflow publishes `vX.Y.Z` and `latest` and finalizes the matching GitHub release.
## Assumptions
- `develop` remains the integration branch and nightly source.
- `main` remains the stable release branch.
- Feature PRs are squash-merged into `develop` with conventional PR titles.
- Promotions from `develop` to `main` preserve cleaned commit history and are not squash merges.
- A release bot or PAT-backed identity can push release commits and tags back to `main`.
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh
set -e
USER_ID="${USER_ID:-1000}"
GROUP_ID="${GROUP_ID:-1000}"
# Create group and user if they don't exist
if ! getent group "$GROUP_ID" >/dev/null 2>&1; then
addgroup -g "$GROUP_ID" -S booklore
fi
if ! getent passwd "$USER_ID" >/dev/null 2>&1; then
adduser -u "$USER_ID" -G "$(getent group "$GROUP_ID" | cut -d: -f1)" -S -D booklore
fi
# Ensure data and bookdrop directories exist and are writable by the target user
mkdir -p /app/data /bookdrop
chown "$USER_ID:$GROUP_ID" /app/data /bookdrop 2>/dev/null || true
exec su-exec "$USER_ID:$GROUP_ID" "$@"
-54
View File
@@ -1,54 +0,0 @@
services:
booklore:
# Official Docker Hub image:
image: booklore/booklore:latest
# Or the GHCR image:
# image: ghcr.io/booklore-app/booklore:latest
container_name: booklore
environment:
- USER_ID=1000 # Modify this if the volume's ownership is not root
- GROUP_ID=1000 # Modify this if the volume's ownership is not root
- TZ=Etc/UTC
- DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore # Only modify this if you're familiar with JDBC and your database setup
- DATABASE_USERNAME=booklore # Must match MYSQL_USER defined in the mariadb container
- DATABASE_PASSWORD=your_secure_password # Use a strong password; must match MYSQL_PASSWORD defined in the mariadb container
- SWAGGER_ENABLED=false # Enable or disable Swagger UI (API docs). Set to 'true' to allow access; 'false' to block access (recommended for production).
- FORCE_DISABLE_OIDC=false # Set to 'true' to force-disable OIDC and allow internal login, regardless of UI config
# ALLOWED_ORIGINS= # Comma-separated list of allowed cross-origin URLs for CORS (e.g. https://app.example.com). Defaults to '*' (allow all) if unset. Leave empty to restrict to same-origin.
# JAVA_TOOL_OPTIONS=-XX:+UseSerialGC -Xmx256m -XX:+UseCompactObjectHeaders -XX:+ExitOnOutOfMemoryError # For very constrained hardware (RPi 3, 512MB RAM). Uncomment and adjust as needed.
depends_on:
mariadb:
condition: service_healthy
ports:
- "6060:6060" # HostPort:ContainerPort — container port is 6060 by default (configurable via BOOKLORE_PORT env var)
volumes:
- ./data:/app/data # Application data (settings, metadata, cache, etc.). Persist this folder to retain your library state across container restarts.
- ./books:/books # Primary book library folder. Mount your collection here so BookLore can access and organize your books.
- ./bookdrop:/bookdrop # BookDrop folder. Files placed here are automatically detected and prepared for import.
healthcheck:
test: wget -q -O - http://localhost:6060/api/v1/healthcheck
interval: 60s
retries: 5
start_period: 60s
timeout: 10s
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:11.4.8
container_name: mariadb
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- MYSQL_ROOT_PASSWORD=super_secure_password # Use a strong password for the database's root user, should be different from MYSQL_PASSWORD
- MYSQL_DATABASE=booklore
- MYSQL_USER=booklore # Must match DATABASE_USERNAME defined in the booklore container
- MYSQL_PASSWORD=your_secure_password # Use a strong password; must match DATABASE_PASSWORD defined in the booklore container
volumes:
- ./config:/config
restart: unless-stopped
healthcheck:
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ]
interval: 5s
timeout: 5s
retries: 10
-2
View File
@@ -1,2 +0,0 @@
[Volume]
VolumeName=booklore-data
-21
View File
@@ -1,21 +0,0 @@
[Unit]
Description=BookLore Database Container Using MariaDB
[Container]
ContainerName=booklore-db
Image=lscr.io/linuxserver/mariadb:11.4.8
Pod=booklore.pod
Pull=always
Volume=booklore-db:/config
Environment=TZ=Etc/UTC
Environment=PUID=0
Environment=PGID=0
Environment=MYSQL_USER=booklore
Secret=booklore_db_pass,type=env,target=MYSQL_ROOT_PASSWORD
Secret=booklore_db_pass,type=env,target=MYSQL_PASSWORD
Environment=MYSQL_DATABASE=booklore
DropCapability=all
AddCapability=CAP_CHOWN CAP_SETUID CAP_SETGID CAP_FOWNER
-2
View File
@@ -1,2 +0,0 @@
[Volume]
VolumeName=booklore-db
-27
View File
@@ -1,27 +0,0 @@
[Unit]
Description=booklore container
Requires=booklore-db.container
After=booklore-db.container
[Container]
ContainerName=booklore
Image=ghcr.io/booklore-app/booklore:latest
Pod=booklore.pod
AutoUpdate=registry
Pull=always
Volume=booklore-data:/app/data
# note the :z is important for selinux systems
# Volume=YOUR MOUNTS:/books:z
# Volume=YOUR MOUNTS:/bookdrop:z
Environment=TZ=Etc/UTC
Secret=booklore_db_pass,type=env,target=DATABASE_PASSWORD
Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/booklore
Environment=DATABASE_USERNAME=booklore
HealthCmd=wget -q -O - http://localhost:6060/api/v1/healthcheck
HealthInterval=1m
HealthRetries=5
HealthStartPeriod=1m
HealthTimeout=10s
+37
View File
@@ -0,0 +1,37 @@
#!/bin/sh
set -e
USER_ID="${USER_ID:-1000}"
GROUP_ID="${GROUP_ID:-1000}"
APP_USER="${APP_USER:-booklore}"
if getent group "$APP_USER" >/dev/null 2>&1; then
existing_group_id="$(getent group "$APP_USER" | cut -d: -f3)"
if [ "$existing_group_id" != "$GROUP_ID" ]; then
echo "ERROR: APP_USER group '$APP_USER' already exists with GID $existing_group_id, expected $GROUP_ID." >&2
exit 1
fi
fi
# Create group and user if they don't exist
if ! getent group "$GROUP_ID" >/dev/null 2>&1; then
addgroup -g "$GROUP_ID" -S "$APP_USER"
fi
if getent passwd "$APP_USER" >/dev/null 2>&1; then
existing_user_id="$(getent passwd "$APP_USER" | cut -d: -f3)"
if [ "$existing_user_id" != "$USER_ID" ]; then
echo "ERROR: APP_USER '$APP_USER' already exists with UID $existing_user_id, expected $USER_ID." >&2
exit 1
fi
fi
if ! getent passwd "$USER_ID" >/dev/null 2>&1; then
adduser -u "$USER_ID" -G "$(getent group "$GROUP_ID" | cut -d: -f1)" -S -D "$APP_USER"
fi
# Ensure data and bookdrop directories exist and are writable by the target user
mkdir -p /app/data /bookdrop
chown "$USER_ID:$GROUP_ID" /app/data /bookdrop 2>/dev/null || true
exec su-exec "$USER_ID:$GROUP_ID" "$@"
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
#
# Weblate Setup Script for BookLore
# Weblate Setup Script for Grimmory
#
# Creates the Weblate project and all translation components via the API.
# Run once after creating your Hosted Weblate account.
#
# Prerequisites:
# 1. Get your API token from https://hosted.weblate.org/accounts/profile/#api
# 2. Ensure your GitHub repo (booklore-app/booklore) is public (required for Libre plan)
# 2. Ensure your GitHub repo (grimmory-tools/grimmory) is public (required for Libre plan)
#
# Usage:
# WEBLATE_TOKEN=your-api-token ./scripts/weblate-setup.sh
@@ -20,11 +20,11 @@ WEBLATE_URL="${WEBLATE_URL:-https://hosted.weblate.org}"
API="${WEBLATE_URL}/api"
TOKEN="${WEBLATE_TOKEN:?Set WEBLATE_TOKEN to your Weblate API token}"
PROJECT_NAME="BookLore"
PROJECT_SLUG="booklore"
PROJECT_WEB="https://github.com/booklore-app/booklore"
PROJECT_NAME="Grimmory"
PROJECT_SLUG="grimmory"
PROJECT_WEB="https://github.com/grimmory-tools/grimmory"
REPO_URL="https://github.com/booklore-app/booklore.git"
REPO_URL="https://github.com/grimmory-tools/grimmory.git"
REPO_BRANCH="develop"
FILE_BASE="booklore-ui/src/i18n"
@@ -2,7 +2,7 @@
set -euo pipefail
# =======================
# Multi-arch Docker Build & Push for Booklore
# Multi-arch Docker Build & Push for Grimmory
# =======================
# Ensure a version/tag is passed
@@ -14,7 +14,7 @@ fi
VERSION="$1"
echo "Building Booklore App with multi-arch version: $VERSION"
echo "Building Grimmory with multi-arch version: $VERSION"
# Ensure Docker Buildx builder exists and is used
docker buildx create --use --name multiarch-builder || true
@@ -22,8 +22,8 @@ docker buildx create --use --name multiarch-builder || true
# Build and push multi-arch Docker image
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t retr0spect101/booklore:"$VERSION" \
-t grimmory/grimmory:"$VERSION" \
--push \
.
echo "Multi-arch Docker image retr0spect101/booklore:$VERSION pushed successfully!"
echo "Multi-arch Docker image grimmory/grimmory:$VERSION pushed successfully!"
@@ -29,8 +29,8 @@ release_name=$(jq -r '.name' <<< "$release_json")
release_body=$(jq -r '.body' <<< "$release_json")
release_url=$(jq -r '.url' <<< "$release_json")
dockerhub_image="https://hub.docker.com/r/booklore/booklore/tags/$NEW_TAG"
ghcr_image="https://github.com/booklore-app/booklore/pkgs/container/booklore/$NEW_TAG"
dockerhub_image="https://hub.docker.com/r/grimmory/grimmory/tags/$NEW_TAG"
ghcr_image="https://github.com/grimmory-tools/grimmory/pkgs/container/grimmory/$NEW_TAG"
# Clean up body for Discord
clean_body=$(echo "$release_body" | tr -d '\r')
@@ -70,4 +70,4 @@ echo "Sending notification to Discord..."
curl -i -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK_URL" \
|| echo "⚠️ Request completed with an error; check the above HTTP response"
echo "Notification sent!"
echo "Notification sent!"
+6199
View File
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
{
"name": "grimmory-release-tooling",
"private": true,
"description": "Release automation tooling for Grimmory",
"engines": {
"node": ">=24"
},
"scripts": {
"release": "semantic-release",
"release:dry-run": "semantic-release --dry-run"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"conventional-changelog-conventionalcommits": "9.3.0",
"semantic-release": "25.0.3"
}
}
+90
View File
@@ -0,0 +1,90 @@
module.exports = {
repositoryUrl: "https://github.com/grimmory-tools/grimmory.git",
branches: ["main"],
tagFormat: "v${version}",
plugins: [
[
"@semantic-release/commit-analyzer",
{
preset: "conventionalcommits",
presetConfig: {
types: [
{ type: "feat", section: "Features", hidden: false },
{ type: "fix", section: "Bug Fixes", hidden: false },
{ type: "perf", section: "Performance", hidden: false },
{ type: "refactor", section: "Refactors", hidden: false },
{ type: "chore", section: "Chores", hidden: false },
{ type: "docs", section: "Documentation", hidden: false },
{ type: "ci", section: "CI", hidden: false },
{ type: "build", section: "Build", hidden: false },
{ type: "test", section: "Tests", hidden: false },
{ type: "style", section: "Style", hidden: false },
{ type: "revert", section: "Reverts", hidden: false }
]
},
parserOpts: {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
releaseRules: [
{ type: "refactor", release: "patch" },
{ type: "docs", release: false },
{ type: "ci", release: false },
{ type: "build", release: false },
{ type: "chore", release: false },
{ type: "test", release: false },
{ type: "style", release: false }
]
}
],
[
"@semantic-release/release-notes-generator",
{
preset: "conventionalcommits",
presetConfig: {
types: [
{ type: "feat", section: "Features", hidden: false },
{ type: "fix", section: "Bug Fixes", hidden: false },
{ type: "perf", section: "Performance", hidden: false },
{ type: "refactor", section: "Refactors", hidden: false },
{ type: "chore", section: "Chores", hidden: false },
{ type: "docs", section: "Documentation", hidden: false },
{ type: "ci", section: "CI", hidden: false },
{ type: "build", section: "Build", hidden: false },
{ type: "test", section: "Tests", hidden: false },
{ type: "style", section: "Style", hidden: false },
{ type: "revert", section: "Reverts", hidden: false }
]
},
parserOpts: {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
},
writerOpts: {
commitsSort: ["scope", "subject"]
}
}
],
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md"],
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
draftRelease: true,
releaseNameTemplate: "Release <%= nextRelease.gitTag %>",
successComment: false,
failComment: false,
releasedLabels: false
}
]
]
};