From cdecc01947d0f41a9dcf50010dad66e0fa4a14dc Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sun, 1 Dec 2024 19:46:15 -0500 Subject: [PATCH] ci: improve release workflow with PR creation - Replace direct push to main with PR creation for new releases - Update dev branch with new release changes - Use GitHub CLI to automate PR creation process - Enhance version control and review process for releases --- .github/workflows/release.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6740b345..45e8f467 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,9 +57,18 @@ jobs: git commit -m "chore: bump version to ${VERSION}" fi - - name: Push changes + - name: Create Pull Request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION=$(node -p "require('./package.json').version") + BRANCH="release/v${VERSION}" + git checkout -b $BRANCH + git push -u origin $BRANCH + gh pr create --base main --head $BRANCH --title "Release v${VERSION}" --body "Automated release PR for version ${VERSION}" + + - name: Update dev branch run: | - git push --follow-tags origin main git checkout dev - git merge main + git merge $BRANCH git push origin dev \ No newline at end of file