From 2bf63ef46ab65626433d7d28e8bd6a07926f11fe Mon Sep 17 00:00:00 2001 From: Souma <101255979+5ouma@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:04:31 +0900 Subject: [PATCH] ci(release): Use tagpr to prepare releasing (#91) Automatically open a PR and bumping the deno.json. --- .github/workflows/release.yml | 24 ++++++------------------ .tagpr | 7 +++++++ 2 files changed, 13 insertions(+), 18 deletions(-) create mode 100644 .tagpr diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43212fe..5a1f3e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,12 @@ on: push: branches: - main - paths: - - deno.json workflow_dispatch: permissions: contents: write id-token: write + pull-requests: write jobs: Release: @@ -19,24 +18,13 @@ jobs: steps: - name: ๐Ÿšš Checkout Repository uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - with: - fetch-depth: 0 - - name: ๐Ÿ” Check the Version - id: version - run: | - version="$(jq -r '.version' deno.json)" - tag="$(git tag -l | sort -V | tail -n 1)" - if [[ "v$version" != "$tag" ]]; then - echo "next=v$version" >> "$GITHUB_OUTPUT" - fi - - - name: ๐Ÿš€ Release a New Version - if: ${{ steps.version.outputs.next != '' }} - run: gh release create "${{ steps.version.outputs.next }}" --generate-notes + - name: ๐Ÿท๏ธ Release a New Version + id: tagpr + uses: Songmu/tagpr@591c6e0c988bccee7dda02bce1af7a3b2dc47065 # v1.4.2 env: - GH_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: ๐Ÿ“ฆ Publish to JSR - if: ${{ steps.version.outputs.next != '' }} + if: ${{ steps.tagpr.outputs.tag != '' }} run: npx jsr publish diff --git a/.tagpr b/.tagpr new file mode 100644 index 0000000..41e04c7 --- /dev/null +++ b/.tagpr @@ -0,0 +1,7 @@ +[tagpr] + releaseBranch = main + versionFile = deno.json + vPrefix = true + changelog = false + majorLabels = ๐Ÿงจ Breaking Change + minorLabels = ๐ŸŽ‰ New Feature