Release Management
Versioning (Semantic Versioning)
The project follows Semantic Versioning (SemVer) with the format MAJOR.MINOR.PATCH:
- MAJOR version (x.0.0): When you make incompatible API changes
- MINOR version (0.x.0): When you add functionality in a backward-compatible manner
- PATCH version (0.0.x): When you make backward-compatible bug fixes
Pre-Release Checklist
Before releasing a new version, ensure you have completed the following:
- All changes are committed and pushed to the
vMAJOR.MINOR.xbranch. - The version number is updated in
package.json(usescripts/update-version.shto synchronise it across files). - All tests pass (in devel mode, local, docker and podman).
- Start a Docker container with
pnpm docker-upand runscripts/compare-versions.shto verify version consistency between development environment and Docker container (requires Docker container to be running). This script compares SQLite versions by major version only (e.g., 3.45.1 vs 3.51.1 are considered compatible), and compares Node, npm, and Duplistatus versions exactly. - Documentation is up to date, update the screenshots (use
pnpm take-screenshots) - Release notes are prepared in
documentation/docs/release-notes/VERSION.md. - Run
scripts/generate-readme-from-intro.shto updateREADME.mdwith the new version and any changes fromdocumentation/docs/intro.md. This script also automatically generatesREADME_dockerhub.mdandRELEASE_NOTES_github_VERSION.md.
Release Process Overview
The recommended release process uses GitHub Pull Requests and Releases (see below). This provides better visibility, review capabilities, and automatically triggers Docker image builds. The command-line method is available as an alternative.
Method 1: GitHub Pull Request and Release (Recommended)
This is the preferred method as it provides better traceability and automatically triggers Docker builds.
Step 1: Create Pull Request
- Navigate to the duplistatus repository on GitHub.
- Click the "Pull requests" tab.
- Click "New pull request."
- Set the base branch to
masterand the compare branch tovMAJOR.MINOR.x. - Review the changes preview to ensure everything looks correct.
- Click "Create pull request."
- Add a descriptive title (e.g., "Release v1.2.0") and description summarizing the changes.
- Click "Create pull request" again.
Step 2: Merge the Pull Request
After reviewing the pull request:
- If there are no conflicts, click the green "Merge pull request" button.
- Choose your merge strategy (typically "Create a merge commit").
- Confirm the merge.
Step 3: Create GitHub Release
Once the merge is complete, create a GitHub release:
- Navigate to the duplistatus repository on GitHub.
- Go to the "Releases" section (or click "Releases" in the right sidebar).
- Click "Draft a new release."
- In the "Choose a tag" field, type your new version number in the format
vMAJOR.MINOR.PATCH(e.g.,v1.2.0). This will create a new tag. - Select
masteras the target branch. - Add a release title (e.g., "Release v1.2.0").
- Add a description documenting the changes in this version. You can:
- Copy the contents from
RELEASE_NOTES_github_VERSION.md(generated byscripts/generate-readme-from-intro.sh) - Or reference release notes from
documentation/docs/release-notes/(but note that relative links won't work in GitHub releases)
- Copy the contents from
- Click "Publish release."
What happens automatically:
- A new Git tag is created
- The "Build and Publish Docker Image" workflow is triggered
- Docker images are built for AMD64 and ARM64 architectures
- Images are pushed to:
- Docker Hub:
wsjbr/duplistatus:VERSIONandwsjbr/duplistatus:latest(if this is the latest release) - GitHub Container Registry:
ghcr.io/wsj-br/duplistatus:VERSIONandghcr.io/wsj-br/duplistatus:latest(if this is the latest release)
- Docker Hub:
Method 2: Command Line (Alternative)
If you prefer using the command line, follow these steps:
Step 1: Update Local Master Branch
Ensure your local master branch is up to date:
# Checkout the master branch
git checkout master
# Pull the latest changes from the remote repository
git pull origin master
Step 2: Merge Development Branch
Merge the vMAJOR.MINOR.x branch into master:
# Merge the vMAJOR.MINOR.x branch into master
git merge vMAJOR.MINOR.x
If there are merge conflicts, resolve them manually:
- Edit the conflicted files
- Stage the resolved files:
git add <file> - Complete the merge:
git commit
Step 3: Tag the Release
Create an annotated tag for the new version:
# Create an annotated tag for the new version
git tag -a vMAJOR.MINOR.PATCH -m "Release vMAJOR.MINOR.PATCH - Brief description"
The -a flag creates an annotated tag (recommended for releases), and the -m flag adds a message.
Step 4: Push to GitHub
Push both the updated master branch and the new tag:
# Push the updated master branch
git push origin master
# Push the new tag
git push origin vMAJOR.MINOR.PATCH
Alternatively, push all tags at once: git push --tags
Step 5: Create GitHub Release
After pushing the tag, create a GitHub release (see Method 1, Step 3) to trigger the Docker build workflow.
Manual Docker Image Build
To manually trigger the Docker image build workflow without creating a release:
- Navigate to the duplistatus repository on GitHub.
- Click on the "Actions" tab.
- Select the "Build and Publish Docker Image" workflow.
- Click "Run workflow".
- Select the branch to build from (typically
master). - Click "Run workflow" again.
Note: Manual builds will not automatically tag images as latest unless the workflow determines it's the latest release.
Releasing Documentation
The documentation is hosted on GitHub Pages and is deployed separately from the application release. Follow these steps to release updated documentation:
Prerequisites
- Ensure you have a GitHub Personal Access Token with the
reposcope. - Set up Git credentials (one-time setup):
cd documentation
./setup-git-credentials.sh
This will prompt you for your GitHub Personal Access Token and store it securely.
Deploy Documentation
- Navigate to the
documentationdirectory:
cd documentation
-
Ensure all documentation changes are committed and pushed to the repository.
-
Build and deploy the documentation:
pnpm run deploy
This command will:
- Build the Docusaurus documentation site
- Push the built site to the
gh-pagesbranch - Make the documentation available at https://wsj-br.github.io/duplistatus/
When to Deploy Documentation
Deploy documentation updates:
- After merging documentation changes to
master - When releasing a new version (if documentation was updated)
- After significant documentation improvements
Note: The documentation deployment is independent of application releases. You can deploy documentation multiple times between application releases.
Preparing Release Notes for GitHub
The generate-readme-from-intro.sh script automatically generates GitHub release notes when run. It reads the release notes from documentation/docs/release-notes/VERSION.md (where VERSION is extracted from package.json) and creates RELEASE_NOTES_github_VERSION.md in the project root.
Example:
# This will generate README.md, README_dockerhub.md, and RELEASE_NOTES_github_VERSION.md
./scripts/generate-readme-from-intro.sh
The generated release notes file can be copied and pasted directly into the GitHub release description. All links and images will work correctly in the GitHub release context.
Note: The generated file is temporary and can be deleted after creating the GitHub release. It's recommended to add RELEASE_NOTES_github_*.md to .gitignore if you don't want to commit these files.
Update README.md
If you've made changes to documentation/docs/intro.md, regenerate the repository README.md:
./scripts/generate-readme-from-intro.sh
This script:
- Extracts the version from
package.json - Generates
README.mdfromdocumentation/docs/intro.md(converts Docusaurus admonitions to GitHub-style alerts, converts links and images) - Creates
README_dockerhub.mdfor Docker Hub (with Docker Hub-compatible formatting) - Generates
RELEASE_NOTES_github_VERSION.mdfromdocumentation/docs/release-notes/VERSION.md(converts links and images to absolute URLs) - Updates the table of contents using
doctoc
Commit and push the updated README.md along with your release.