From f1124815b27deaee4c497baf2dcc44daaca2adc3 Mon Sep 17 00:00:00 2001 From: Akram Tabka Date: Wed, 19 Feb 2025 00:13:34 +0100 Subject: [PATCH] ci: add release workflow via PR --- .github/workflows/release.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3f457f..5e0fdee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,10 +39,31 @@ jobs: npm version $VERSION_BUMP --no-git-tag-version -m "chore(release): %s" npx conventional-changelog -p conventionalcommits -i CHANGELOG.md -s - - name: Commit & Push Changes + - name: Commit Changes run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add . git commit -m "chore(release): $(node -p "require('./package.json').version")" - git push --follow-tags \ No newline at end of file + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "Release version $(node -p "require('./package.json').version")" + body: "This PR bumps the version to $(node -p "require('./package.json').version")." + base: main + branch: release/${{ github.event.inputs.version-bump }} + draft: false + + - name: Merge Pull Request + run: | + gh pr merge "release/${{ github.event.inputs.version-bump }}" --merge --auto --admin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Tags + run: | + git push --follow-tags + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}