A static site generator for viewing GitHub release information with a beautiful and user-friendly interface. This project allows you to create an elegant documentation website to showcase releases, changelogs, and assets from any GitHub repository.
- Bun for TypeScript runtime
- pnpm for package management
- rsync for syncing files
- curl or wget for downloading files
# Clone the repository
git clone https://github.com/Cnily03/release-viewer.git
cd release-viewer
# Install dependencies
pnpm install- Copy the
.env.samplefile to.envand set your environment variables as needed. - Generate a release configuration using the
generate.tsscript (see Usage section). - Build the static site by running
pnpm build.
The static site requires a configuration file that contains release data fetched from a GitHub repository.
Run the generate.ts script to fetch release data from a GitHub repository and generate a configuration file.
bun run generate.ts <repo_fullname> [...options]Options:
Usage: ./generate.ts <repo_fullname> [...options]
Options:
-h, --help Show this help message
-o, --output <file> Output file
--token <token> GitHub API token (or set GITHUB_TOKEN env variable)
--reduce <major[,minor[,patch]]> Reduce releases to at most major/minor/patch releases
--ignore-empty-assets Ignore releases with no assets
Simply run pnpm build to build the static site using the generated configuration in the current directory.
It also contains the following extended options:
--base <base>- Base URL for the front-end (e.g.,/app/, default as perastro.config.mts)-c, --config <file>- Path to the configuration file (default:config.json)-d, --out-dir <directory>- Output directory for the built site (default as perastro.config.mts)
The project provides a sync.ts script to download release assets and sync them to a specified destination.
Usage:
Usage: sync.ts <repo_fullname> [...options] [..generate options]
Basic Options:
-h,
--help Show this help message
-o,
--save <path> Save generated configuration to file
-c,
--compare <path> Compare with former configuration file
Download Options:
-d,
--download-target <directory> Directory for downloaded files
-t,
--url-template <template> Template URL for downloading files (user-facing)
--fast-fail Fail immediately on download error
--fast-sync Synchronize files to downloaded directory after download immediately
--concurrency <number> Number of concurrent downloads (default: 1)
--token <token> GitHub API token (or set GITHUB_TOKEN env variable)
Build Options:
-b,
--build-base <base> Base URL for building front-end (e.g., /app/)
--www-root <directory> Root directory for the front-end website
The following options arguments are supported remote path for rsync:
-d, --download-target <directory>--www-root <directory>-c, --compare <path>-o, --save <path>
Behavior:
When running the sync.ts script, it will:
- Generate the release configuration using the provided repository fullname and options.
- Compare it and calculate the differences with a former configuration file if provided, otherwise consider all assets as new in differences.
- According to the differences, download new or updated assets to the specified download target directory.
- Build the static site.
- Delete assets that are no longer present in the latest configuration.
About URL Template:
When using the -t, --url-template option in sync.ts, you can use these variables:
{tag}- Release tag name{name}- Asset file name{release}- Release name{url}- Original download URL
Copyright (c) Cnily03. All rights reserved.
Licensed under the MIT License.