From ac64e572ba9766a46eea589ca4477e1d00fb2577 Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Sat, 17 Feb 2024 10:24:03 +0700 Subject: [PATCH] update. --- .github/workflows/release.yaml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9a36d15e2b..edfb102de0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Configure Git run: | @@ -20,22 +22,31 @@ jobs: - name: Create New Branch and Update version in setup.cfg run: | - NEW_VERSION=${{ github.event.release.tag_name }} # Keep the 'v' prefix + NEW_VERSION="${{ github.event.release.tag_name }}" # Assuming the 'v' prefix is included NEW_BRANCH="release-${NEW_VERSION}" - echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV + echo "Creating new branch: $NEW_BRANCH" git checkout -b $NEW_BRANCH - sed -i "s/^version = .*/version = $NEW_VERSION/" setup.cfg # Use $NEW_VERSION directly + # Update the version in setup.cfg + sed -i "s/^version = .*/version = $NEW_VERSION/" setup.cfg git add setup.cfg - git commit -m "Release EEST $NEW_VERSION" - git push origin $NEW_BRANCH + git commit -m "feat(docs|fw): release EEST $NEW_VERSION" + git push --set-upstream origin $NEW_BRANCH + + - name: Check changes after sed command + run: | + git diff + + - name: List differences between new branch and main + run: | + git fetch origin main:main + git diff main...$NEW_BRANCH - name: Create Pull Request uses: peter-evans/create-pull-request@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Ensure you're passing the GITHUB_TOKEN with: - branch: ${{ env.NEW_BRANCH }} # Use the NEW_BRANCH environment variable - commit-message: "Release EEST `${{ github.event.release.tag_name }}`" - title: "feat(docs|fw): release EEST `${{ github.event.release.tag_name }}`" - body: "This PR updates the framework version in setup.cfg to `${{ github.event.release.tag_name }}`." + token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ env.NEW_BRANCH }} + commit-message: "Release EEST $NEW_VERSION" + title: "feat(docs|fw): release EEST $NEW_VERSION" + body: "This PR updates the framework version in setup.cfg to $NEW_VERSION." base: main