-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Implement automated release note generation with GitHub Actions #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
6
commits into
main
Choose a base branch
from
copilot/fix-4a1821e0-4b11-4ee8-912e-45ce8f7b5f8b
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dae1d01
Initial plan
Copilot 78f8c65
Add release automation GitHub Actions workflow
Copilot 9e6957c
Add release automation documentation
Copilot 7c2e636
Add release automation examples and cross-references
Copilot d995010
Add required permissions to release automation workflow
Copilot 25df0d0
fix: apply review feedback - improve workflow robustness and fix docu…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| # Release Automation Example | ||
|
|
||
| This guide shows practical examples of creating releases using the automated workflow. | ||
|
|
||
| ## Example 1: Releasing a Frontend App (Tool) | ||
|
|
||
| Let's say you've added new features to the `tool` app and want to release version `0.3.1`: | ||
|
|
||
| ```bash | ||
| # 1. Navigate to the tool app directory | ||
| cd apps/frontend/tool | ||
|
|
||
| # 2. Check the current version | ||
| cat package.json | grep version | ||
| # Output: "version": "0.3.0" | ||
|
|
||
| # 3. Update the version | ||
| npm version patch | ||
| # This updates package.json to "version": "0.3.1" | ||
|
|
||
| # 4. Commit the change | ||
| git add package.json | ||
| git commit -m "chore(tool): bump version to 0.3.1" | ||
|
|
||
| # 5. Push to main or a release branch | ||
| git push origin main | ||
| # or | ||
| git push origin tool/release/0.3.1 | ||
| ``` | ||
|
|
||
| **What happens automatically:** | ||
| 1. GitHub Actions detects the version change | ||
| 2. Creates tag: `@apps/frontend/[email protected]` | ||
| 3. Generates release notes with commit history | ||
| 4. Creates GitHub release at: https://github.com/99mini/voyage/releases/tag/@apps/frontend/[email protected] | ||
|
|
||
| ## Example 2: Releasing a Package (VDS) | ||
|
|
||
| ```bash | ||
| # 1. Navigate to the package directory | ||
| cd packages/vds | ||
|
|
||
| # 2. Update version for a minor release | ||
| npm version minor | ||
| # Changes version from "0.1.2" to "0.2.0" | ||
|
|
||
| # 3. Commit | ||
| git add package.json | ||
| git commit -m "chore(vds): release v0.2.0 with new components" | ||
|
|
||
| # 4. Push | ||
| git push origin main | ||
| ``` | ||
|
|
||
| **Result:** | ||
| - Tag created: `@packages/[email protected]` | ||
| - Release notes include all commits to the vds package | ||
| - GitHub release created automatically | ||
|
|
||
| ## Example 3: Releasing a Server App (REST API) | ||
|
|
||
| ```bash | ||
| # 1. Navigate to server rest directory | ||
| cd apps/server/rest | ||
|
|
||
| # 2. Make a major version bump (breaking changes) | ||
| npm version major | ||
| # Changes from "1.4.2" to "2.0.0" | ||
|
|
||
| # 3. Commit with detailed message | ||
| git add package.json | ||
| git commit -m "chore(server-rest): release v2.0.0 with breaking API changes | ||
|
|
||
| BREAKING CHANGE: Updated authentication endpoints" | ||
|
|
||
| # 4. Push | ||
| git push origin main | ||
| ``` | ||
|
|
||
| **Result:** | ||
| - Tag: `@apps/server/[email protected]` | ||
| - Release notes will include the breaking change message | ||
| - Automatically creates GitHub release | ||
|
|
||
| ## Example 4: Multiple Package Releases in One Commit | ||
|
|
||
| ```bash | ||
| # Update multiple packages that depend on each other | ||
| cd packages/vds | ||
| npm version patch | ||
|
|
||
| cd ../../apps/frontend/tool | ||
| npm version patch | ||
|
|
||
| # Commit all changes together | ||
| git add . | ||
| git commit -m "chore: release [email protected] and [email protected]" | ||
|
|
||
| git push origin main | ||
| ``` | ||
|
|
||
| **Result:** | ||
| - Two tags created: `@packages/[email protected]` and `@apps/frontend/[email protected]` | ||
| - Two separate releases created | ||
| - Each with their own release notes | ||
|
|
||
| ## Checking Release Status | ||
|
|
||
| ```bash | ||
| # View all tags | ||
| git tag -l "@apps/*" "@packages/*" | ||
|
|
||
| # View recent releases | ||
| gh release list | ||
|
|
||
| # View a specific release | ||
| gh release view @apps/frontend/[email protected] | ||
| ``` | ||
|
|
||
| ## Release Branch Workflow | ||
|
|
||
| For production releases, you might want to use release branches: | ||
|
|
||
| ```bash | ||
| # 1. Create a release branch | ||
| git checkout -b tool/release/0.3.1 | ||
|
|
||
| # 2. Update version | ||
| cd apps/frontend/tool | ||
| npm version 0.3.1 | ||
|
|
||
| # 3. Commit | ||
| git add package.json | ||
| git commit -m "chore(tool): prepare release 0.3.1" | ||
|
|
||
| # 4. Push the release branch | ||
| git push origin tool/release/0.3.1 | ||
| # The workflow triggers and creates the release | ||
|
|
||
| # 5. Merge to main after verification | ||
| git checkout main | ||
| git merge tool/release/0.3.1 | ||
| git push origin main | ||
| ``` | ||
|
|
||
| ## Common Commands | ||
|
|
||
| ```bash | ||
| # Check current version | ||
| jq -r '.version' package.json | ||
|
|
||
| # List all app/package versions | ||
| find apps packages -name "package.json" -exec sh -c 'echo "$1: $(jq -r .version "$1")"' _ {} \; | ||
|
|
||
| # Create a pre-release version | ||
| npm version prerelease --preid=beta | ||
| # e.g., 0.3.0 -> 0.3.1-beta.0 | ||
|
|
||
| # View git history for a package | ||
| git log --oneline -- apps/frontend/tool | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Release not created | ||
| 1. Check if version actually changed: `git diff HEAD~1 -- package.json` | ||
| 2. Verify you pushed to correct branch: `git branch -a` | ||
| 3. Check workflow logs: Visit GitHub Actions tab | ||
|
|
||
| ### Tag already exists | ||
| ```bash | ||
| # Delete local tag | ||
| git tag -d @apps/frontend/[email protected] | ||
|
|
||
| # Delete remote tag | ||
| git push origin :refs/tags/@apps/frontend/[email protected] | ||
|
|
||
| # Push updated version | ||
| git push origin main | ||
| ``` | ||
|
|
||
| ## Best Practices | ||
|
|
||
| 1. **Always test before releasing**: Build and test your changes | ||
| 2. **Follow semantic versioning**: | ||
| - Patch (0.0.x): Bug fixes | ||
| - Minor (0.x.0): New features (backward compatible) | ||
| - Major (x.0.0): Breaking changes | ||
| 3. **Write clear commit messages**: They appear in release notes | ||
| 4. **Use release branches** for production releases | ||
| 5. **Verify the release** after it's created | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Release Automation Guide](.docs/release-automation.md) | ||
| - [Contributing Guide](../README.MD#contributing) | ||
| - [Git Flow](../README.MD#git-flow) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| # Release Automation | ||
|
|
||
| This document describes the automated release process for the Voyage monorepo. | ||
|
|
||
| ## Overview | ||
|
|
||
| The release automation workflow automatically creates GitHub releases and tags when package versions are updated in `package.json` files. | ||
|
|
||
| ## How It Works | ||
|
|
||
| 1. **Trigger**: The workflow runs on every push to: | ||
| - `main` branch | ||
| - Release branches (`*/release/**`) | ||
| - Dev release branches (`*/dev-release`) | ||
|
|
||
| 2. **Detection**: The workflow detects changes in `package.json` files within: | ||
| - `apps/frontend/*` | ||
| - `apps/server/*` | ||
| - `apps/cli/*` | ||
| - `packages/*` | ||
|
|
||
| 3. **Tag Creation**: When a version change is detected, a tag is created with the format: | ||
| - Apps: `@apps/<category>/<app-name>@x.y.z` | ||
| - Packages: `@packages/<package-name>@x.y.z` | ||
|
|
||
| 4. **Release Notes**: Automatically generates release notes containing: | ||
| - Commit history since the last release | ||
| - Package information (name, version, path) | ||
| - Release date | ||
|
|
||
| ## Tag Format Examples | ||
|
|
||
| ### Frontend Apps | ||
| - `@apps/frontend/[email protected]` | ||
| - `@apps/frontend/[email protected]` | ||
| - `@apps/frontend/[email protected]` | ||
| - `@apps/frontend/[email protected]` | ||
| - `@apps/frontend/[email protected]` | ||
|
|
||
| ### Server Apps | ||
| - `@apps/server/[email protected]` | ||
| - `@apps/server/[email protected]` | ||
|
|
||
| ### Packages | ||
| - `@packages/[email protected]` | ||
| - `@packages/[email protected]` | ||
| - `@packages/[email protected]` | ||
|
|
||
| ## Creating a Release | ||
|
|
||
| To create a new release: | ||
|
|
||
| 1. **Update the version** in the appropriate `package.json`: | ||
| ```bash | ||
| # For example, updating the tool app | ||
| cd apps/frontend/tool | ||
| npm version patch # or minor, major | ||
| ``` | ||
|
|
||
| 2. **Commit the change**: | ||
| ```bash | ||
| git add package.json | ||
| git commit -m "chore: bump tool version to 0.3.1" | ||
| ``` | ||
|
|
||
| 3. **Push to a release branch or main**: | ||
| ```bash | ||
| git push origin main | ||
| # or | ||
| git push origin tool/release/0.3.1 | ||
| ``` | ||
|
|
||
| 4. **Automated steps** (handled by GitHub Actions): | ||
| - Workflow detects the version change | ||
| - Creates a tag (e.g., `@apps/frontend/[email protected]`) | ||
| - Generates release notes | ||
| - Creates a GitHub release | ||
|
|
||
| ## Release Notes Content | ||
|
|
||
| Release notes include: | ||
|
|
||
| - **Title**: `Release <package-name>@<version>` | ||
| - **Changes**: List of commits since the last release | ||
| - **Package Information**: | ||
| - Package name | ||
| - Version | ||
| - Path in repository | ||
| - Release date (UTC) | ||
|
|
||
| ## Workflow File | ||
|
|
||
| The workflow is defined in `.github/workflows/release-automation.yml`. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - The workflow requires push access to create tags | ||
| - Uses the default `GITHUB_TOKEN` for authentication | ||
| - Requires `gh` CLI (pre-installed on GitHub Actions runners) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### No release created | ||
| - Verify that the version in `package.json` actually changed | ||
| - Check that the push was to a monitored branch (main or release branches) | ||
| - Review workflow logs in the Actions tab | ||
|
|
||
| ### Tag already exists | ||
| - The workflow will skip creating a tag if it already exists | ||
| - Delete the existing tag if you need to recreate it: | ||
| ```bash | ||
| git tag -d @apps/frontend/[email protected] | ||
| git push origin :refs/tags/@apps/frontend/[email protected] | ||
| ``` | ||
|
|
||
| ### Release notes are empty | ||
| - This may occur for new packages with no previous tags | ||
| - The workflow will show recent commits instead | ||
|
|
||
| ## Best Practices | ||
|
|
||
| 1. **Follow semantic versioning** (major.minor.patch) | ||
| 2. **Update versions in release branches** before merging to main | ||
| 3. **Write meaningful commit messages** - they appear in release notes | ||
| 4. **Test changes** before bumping versions | ||
| 5. **Keep package.json version in sync** with actual released features | ||
|
|
||
| ## Manual Release Creation | ||
|
|
||
| If you need to create a release manually: | ||
|
|
||
| ```bash | ||
| # Create tag | ||
| git tag -a @apps/frontend/[email protected] -m "Release [email protected]" | ||
| git push origin @apps/frontend/[email protected] | ||
|
|
||
| # Create release using gh CLI | ||
| gh release create @apps/frontend/[email protected] \ | ||
| --title "Release [email protected]" \ | ||
| --notes "Release notes here" | ||
| ``` | ||
|
|
||
| ## Examples | ||
|
|
||
| For practical examples of using the release automation, see [Release Automation Examples](./release-automation-example.md). | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Release Automation Examples](./release-automation-example.md) | ||
| - [Contributing Guide](../README.MD#contributing) | ||
| - [Git Flow](../README.MD#git-flow) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relative path is incorrect. Since this file is located in
.docs/, the reference should be./release-automation.md(without the.docs/prefix) or use an absolute path from the repository root.