Build and Release Process
May 3, 2025 ยท View on GitHub
This document explains the build and release process for the Plexyfin plugin.
Overview
The build system uses a "releases" directory as the single source of truth for versioning. Each version has its own JSON file in this directory, which contains all the metadata for that release.
Directory Structure
releases/: Contains JSON files for each version (e.g.,0.5.0.0.json,0.6.0.0.json)dist/: Output directory for buildsmetadata/stable/: Repository metadata for the Jellyfin plugin catalog
Build Scripts
The following scripts handle the build and release process:
new_version.sh- Creates new versionsbuild_release.sh- Builds and packages a versiontag_and_release.sh- Tags and pushes releases to Gitprepare_github_release.sh- Prepares files for GitHub releases
Creating a New Version
To create a new version:
./new_version.sh <new_version>
For example:
./new_version.sh 0.6.0.0
This will:
- Create a new JSON file in the
releasesdirectory based on the latest version - Update the version number in the file
- Open the file in an editor so you can update the changelog and other details
Building a Version
To build a specific version:
./build_release.sh <version>
For example:
./build_release.sh 0.5.0.0
This will:
- Read the version metadata from the corresponding file in the
releasesdirectory - Update
meta.jsonand the.csprojfile with the correct version - Build the plugin
- Create a ZIP file for distribution
- Calculate checksums
Building and Updating the Repository
To build a version and update the repository manifest:
./build_release.sh <version> --deploy
This will perform the build steps and also:
- Update the
metadata/stable/manifest.jsonfile with the new version - Preserve all existing versions in the manifest
- Create a Git tag for the version (but not push it to remote)
Tagging and Pushing a Release
To create a Git tag for a version and optionally push it to the remote repository:
# Tag only
./tag_and_release.sh <version>
# Tag and push to remote
./tag_and_release.sh <version> --push
This will:
- Check if the version exists and has been built
- Commit any uncommitted changes if desired
- Create a Git tag for the version
- Optionally push the tag and commits to the remote repository
Preparing a GitHub Release
After building and tagging a version, prepare files for a GitHub release:
./prepare_github_release.sh <version>
This will:
- Copy the necessary files to a
github_releasedirectory - Generate release notes based on the changelog
- Provide instructions for creating a GitHub release
Using the Latest Version
To build the latest version available in the releases directory:
./build_release.sh latest
Workflow for a New Release
- Create a new version:
./new_version.sh 0.6.0.0 - Edit the changelog and other details in the generated file
- Build and test locally:
./build_release.sh 0.6.0.0 - When ready to release, update the repository:
./build_release.sh 0.6.0.0 --deploy - Tag and push the release:
./tag_and_release.sh 0.6.0.0 --push - Prepare for GitHub release:
./prepare_github_release.sh 0.6.0.0 - Create a GitHub release using the prepared files
Tips and Best Practices
- Always use the scripts to manage versions to ensure consistency
- The
releasesdirectory serves as the version history of the plugin - When modifying the build scripts, ensure they continue to use the
releasesdirectory as the source of truth - For automated CI/CD pipelines, use
./build_release.sh latest --deploy