Skip to content

Commit

Permalink
feat(wren-ai-service): produce change log in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
paopa committed Jul 12, 2024
1 parent 3dbd4f0 commit 44335b5
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/ai-service-release-stable-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "wren-ai[bot]"
Expand All @@ -37,14 +38,40 @@ jobs:
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.8.3
- name: Generate and Save Change Log
id: changelog
run: |
echo "Generating change log..."
PREVIOUS_VERSION=release/ai-service/$(poetry version -s)
echo "Previous version: $PREVIOUS_VERSION"
CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ai-service)
# Separate the change log into categories
FEATURES=$(echo "$CHANGE_LOG" | grep "^feat" | sed 's/^/- /')
FIXES_AND_CHORES=$(echo "$CHANGE_LOG" | grep -E "^(fix|chore)" | sed 's/^/- /')
# Create the full change log
FULL_CHANGE_LOG="\nChangelog for the version\n"
if [ -n "$FEATURES" ]; then
FULL_CHANGE_LOG+="\nFeature and Enhancement\n$FEATURES"
fi
if [ -n "$FIXES_AND_CHORES" ]; then
FULL_CHANGE_LOG+="\n\nFixes and Chores\n$FIXES_AND_CHORES"
fi
{
echo "CHANGE_LOG<<EOF"
echo -e "$FULL_CHANGE_LOG"
echo EOF
} >> $GITHUB_ENV
- name: Upgrade AI Service version
run: |
version=${{ github.event.inputs.version }}
poetry version --next-phase $version
git add pyproject.toml
git commit -m "Upgrade AI Service version to $version"
git push
git tag -a "release/ai-service/$version" -m "Release version $version"
git tag -a "release/ai-service/$version" -m "${{ env.CHANGE_LOG }}"
git push origin "release/ai-service/$version"
build-image:
needs: upgrade-ai-service-version
Expand Down

0 comments on commit 44335b5

Please sign in to comment.