diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1244efb..ff11daa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,17 +32,31 @@ jobs: run: | git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' + git checkout -b release-branch git add package.json - git commit -m "chore(release): ${{ steps.bump_version.outputs.new_version }}" - git tag ${{ steps.bump_version.outputs.new_version }} - git push origin HEAD --tags + git commit -S -m "chore(release): ${{ steps.bump_version.outputs.new_version }}" + git push origin release-branch env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + + - name: Create Pull Request + id: create_pr + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'chore(release): ${{ steps.bump_version.outputs.new_version }}' + branch: release-branch + title: 'Release ${{ steps.bump_version.outputs.new_version }}' + body: 'Automated release of version ${{ steps.bump_version.outputs.new_version }}' - name: Build the project + if: github.event_name == 'pull_request' run: yarn build - name: Publish to npm + if: github.event_name == 'pull_request' && github.event.pull_request.merged run: yarn publish --non-interactive env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}