Enable poetry Interpreter in morph new Command #32
This file contains 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
name: Release Drafter | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- develop | |
- release/* | |
jobs: | |
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 }} |