Skip to content

Commit

Permalink
Merge branch 'develop' into fix/readme-quick-start
Browse files Browse the repository at this point in the history
  • Loading branch information
shibatanaoto committed Jan 12, 2025
2 parents aa5fa09 + b642642 commit 68abbd1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 New Features'
labels:
Expand All @@ -20,4 +20,4 @@ template: |
$CHANGES
---
---
53 changes: 50 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,62 @@
name: Release Drafter

on:
push:
branches: develop
pull_request:
types:
- closed
branches:
- develop
- release/*

jobs:
update_release_draft:
draft_release_notes:
# develop branch or minor release branch
if: >
(github.event.pull_request.base.ref == 'develop' &&
!startsWith(github.event.pull_request.head.ref, 'release/') &&
github.event.pull_request.head.ref != 'main') ||
(startsWith(github.event.pull_request.base.ref, 'release/') &&
endsWith(github.event.pull_request.base.ref, '0'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get current version from tags
id: get_current_version
run: |
# fetch all tags
git fetch --tags
# Find the latest tag using semantic versioning
CURRENT_VERSION=$(git tag -l --sort=-v:refname | head -n 1)
if [ -z "$CURRENT_VERSION" ]; then
CURRENT_VERSION="v0.0.0" # Default if no tags exist
fi
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Determine next version
id: determine_next_version
run: |
if [[ "${{ github.event.pull_request.base.ref }}" == "develop" ]]; then
# Increment the minor version
IFS='.' read -r -a parts <<< "${CURRENT_VERSION#v}"
MAJOR=${parts[0]}
MINOR=${parts[1]}
PATCH=${parts[2]}
NEXT_VERSION="v${MAJOR}.$((MINOR + 1)).0"
elif [[ "${{ github.event.pull_request.base.ref }}" == release/* ]]; then
# Use the release branch version
base_ref="${{ github.event.pull_request.base.ref }}"
NEXT_VERSION="${base_ref#release/}"
fi
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_ENV
echo "Next version: ${NEXT_VERSION}"
- name: Update release draft
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.NEXT_VERSION }}
name: ${{ env.NEXT_VERSION }}
version: ${{ env.NEXT_VERSION }}

0 comments on commit 68abbd1

Please sign in to comment.