Skip to content

Commit

Permalink
ci(release): Use tagpr to prepare releasing (#91)
Browse files Browse the repository at this point in the history
Automatically open a PR and bumping the deno.json.
  • Loading branch information
5ouma authored Oct 22, 2024
1 parent e991df7 commit 2bf63ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ on:
push:
branches:
- main
paths:
- deno.json
workflow_dispatch:

permissions:
contents: write
id-token: write
pull-requests: write

jobs:
Release:
Expand All @@ -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
7 changes: 7 additions & 0 deletions .tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tagpr]
releaseBranch = main
versionFile = deno.json
vPrefix = true
changelog = false
majorLabels = 🧨 Breaking Change
minorLabels = πŸŽ‰ New Feature

0 comments on commit 2bf63ef

Please sign in to comment.