Skip to content
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

build(ci): automate release version #3018

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# .github/release-drafter.yml

name-template: 'Release v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
label: 'feat'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- 'fix'
- title: '🛠 Maintenance'
label: 'chore'
- title: '🔧 Build System'
label: 'build'
- title: '📦 CI/CD'
label: 'ci'
- title: '📝 Documentation'
label: 'docs'
- title: '💄 Style'
label: 'style'
- title: '♻️ Refactoring'
label: 'refactor'
- title: '⚡️ Performance Improvements'
label: 'perf'
- title: '🧪 Testing'
label: 'test'

change-template: '- $BODY by @$AUTHOR' # This will include the full PR description
no-changes-template: "No notable changes in this release."

# Optional customization to control how the version is incremented
version-template: $MAJOR.$MINOR.$PATCH
4 changes: 3 additions & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ jobs:
# Extract the new version from package.json
new_version=$(node -p "require('./package.json').version")
echo "New version: $new_version"
echo "::set-output name=new_version::$new_version"
echo "{new_version}={new_version}" >> $GITHUB_OUTPUT

- name: Commit version bump on release branch
run: |
branch_name="release/v${{ steps.bump_version.outputs.new_version }}"
git checkout -b "$branch_name"
git add package.json package-lock.json
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
git commit -m "Bump version to ${{ steps.bump_version.outputs.new_version }}"
git push origin "$branch_name"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
run: |
version=$(node -p "require('./package.json').version")
echo "Version from package.json: $version"
echo "::set-output name=version::$version"

echo "{version}={version}" >> $GITHUB_OUTPUT
- name: Create Git tag
run: |
git tag -a "v${{ steps.get_version.outputs.version }}" -m "Release v${{ steps.get_version.outputs.version }}"
Expand Down
Loading