Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tagpr to prepare releasing #91

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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