The upgrade module adds a CLI command that updates the current binary from GitHub Releases.
This module provides in-place upgrades for applications that publish release assets to GitHub. It:
- Resolves the target release (latest or
--version) - Downloads the asset matching the current OS/architecture
- Swaps the executable in-place using
.new/.oldfiles - Logs a no-op when the target version is equal or lower (unless
--force)
- App source:
util.AppSourcemust be a GitHub repository URL likehttps://github.com/{org}/{repo}. - Semver tags: Release tags must be semantic versions (for example
v1.2.3). - Semver build: The current build version must also be semantic (used for comparisons).
- Asset naming: Releases must include a zip asset named:
${AppKey}_${version}_${GOOS}_${GOARCH}.zip
- Zip contents: The zip file must contain a single binary (no nested folders or extra files).
- Permissions: The process needs write access to the installed binary location.
# Upgrade to the latest release
./your-app upgrade
# Upgrade to a specific version (leading "v" is optional)
./your-app upgrade --version 1.2.3
# Force upgrade even if the target version is older or equal
./your-app upgrade --force--version- Release tag or version number to upgrade to (for example1.2.3orv1.2.3)--force,-f- Upgrade even if the target version is equal or lower than the current build
./myapp upgrade --version v1.2.3GITHUB_TOKEN(orgithub_token) - Optional GitHub token for authenticated API access and private repos
The module relies on application constants generated by Project Forge:
AppSource- GitHub repository URL used to resolve releasesAppKey- Used to match release asset names
These are defined in app/util/keys.go in the generated application.
- CLI:
upgrade(available in the application command set) - GitHub Releases:
https://github.com/{org}/{repo}/releases
- 404 or "can't access repository": Confirm
AppSourceis a valid GitHub URL. - "no asset available": Ensure asset names match
${AppKey}_${version}_${GOOS}_${GOARCH}.zip. - Permission errors: Run the upgrade command with permissions to replace the binary.
- Repository: https://github.com/kyleu/projectforge/tree/main/module/upgrade
- License: CC0 (Public Domain)
- Author: Kyle U (kyle@kyleu.com)
- Project Forge Documentation - Complete documentation
- GitHub Releases API - GitHub API documentation