-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (35 loc) · 1011 Bytes
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: 🚀 Release
on:
push:
branches:
- main
paths:
- deno.json
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
Release:
runs-on: Ubuntu-Latest
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
env:
GH_TOKEN: ${{ github.token }}
- name: 📦 Publish to JSR
if: ${{ steps.version.outputs.next != '' }}
run: npx jsr publish