mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
- Added steps for committing version bumps and creating git tags in the release process. - Clarified the verification steps to include checking the visibility of tags on the remote repository.
2.9 KiB
2.9 KiB
Release Command
Bump the package.json version (major, minor, or patch) and build the Electron app with the new version.
Usage
This command accepts a version bump type as input:
patch- Bump patch version (0.1.0 -> 0.1.1)minor- Bump minor version (0.1.0 -> 0.2.0)major- Bump major version (0.1.0 -> 1.0.0)
Instructions
-
Get the bump type from the user
- The bump type should be provided as an argument (patch, minor, or major)
- If no type is provided, ask the user which type they want
-
Bump the version
- Run the version bump script:
node apps/ui/scripts/bump-version.mjs <type> - This updates both
apps/ui/package.jsonandapps/server/package.jsonwith the new version (keeps them in sync) - Verify the version was updated correctly by checking the output
- Run the version bump script:
-
Build the Electron app
- Run the electron build:
npm run build:electron --workspace=apps/ui - The build process automatically:
- Uses the version from
package.jsonfor artifact names (e.g.,Automaker-1.2.3-x64.zip) - Injects the version into the app via Vite's
__APP_VERSION__constant - Displays the version below the logo in the sidebar
- Uses the version from
- Run the electron build:
-
Commit the version bump
- Stage the updated package.json files:
git add apps/ui/package.json apps/server/package.json - Commit with a release message:
git commit -m "chore: release v<version>"
- Stage the updated package.json files:
-
Create and push the git tag
- Create an annotated tag for the release:
git tag -a v<version> -m "Release v<version>" - Push the commit and tag to remote:
git push && git push --tags
- Create an annotated tag for the release:
-
Verify the release
- Check that the build completed successfully
- Confirm the version appears correctly in the built artifacts
- The version will be displayed in the app UI below the logo
- Verify the tag is visible on the remote repository
Version Centralization
The version is centralized and synchronized in both apps/ui/package.json and apps/server/package.json:
- Electron builds: Automatically read from
apps/ui/package.jsonvia electron-builder's${version}variable inartifactName - App display: Injected at build time via Vite's
defineconfig as__APP_VERSION__constant (defined inapps/ui/vite.config.mts) - Server API: Read from
apps/server/package.jsonviaapps/server/src/lib/version.tsutility (used in health check endpoints) - Type safety: Defined in
apps/ui/src/vite-env.d.tsasdeclare const __APP_VERSION__: string
This ensures consistency across:
- Build artifact names (e.g.,
Automaker-1.2.3-x64.zip) - App UI display (shown as
v1.2.3below the logo inapps/ui/src/components/layout/sidebar/components/automaker-logo.tsx) - Server health endpoints (
/and/detailed) - Package metadata (both UI and server packages stay in sync)