Skip to content

Commit

Permalink
add wren-ui tag before releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyjackfrost committed Oct 28, 2024
1 parent f400ee8 commit bbec427
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ui-release-image-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,62 @@ defaults:
working-directory: wren-ui

jobs:
tag-ui-version:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- 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-ui[bot]"
git config --global user.email "dev@cannerdata.com"
- name: Generate and Save Change Log
id: changelog
run: |
echo "Generating change log..."
PREVIOUS_VERSION=release/wren-ui/$(cd wren-ui && yarn version --json | grep '"data"' | sed -E 's/.*"Current version: ([^"]+)".*/\1/')
echo "Previous version: $PREVIOUS_VERSION"
echo "================ change log ================"
CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ui)
echo "================ change log ================"
# 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: Update Wren-UI version
run: |
version=${{ github.event.inputs.version }}
sed -i '' 's/"version": "[^"]*"/"version": "'"$version"'"/' ./wren-ui/package.json
git add ./wren-ui/package.json
git commit -m "update wren-ui version to $version"
git push
git tag -a "release/wren-ui/$version" -m "${{ env.CHANGE_LOG }}"
git push origin "release/wren-ui/$version"
build-image:
needs: tag-ui-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit bbec427

Please sign in to comment.