-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.23 KB
/
publish-jsr.yml
File metadata and controls
52 lines (43 loc) · 1.23 KB
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
43
44
45
46
47
48
49
50
51
52
name: Publish to JSR
on:
push:
tags:
- "v*.*.*"
- "*.*.*"
permissions:
contents: read
id-token: write
concurrency:
group: publish-jsr-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x
- name: Verify tag matches deno.json version
shell: bash
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
tag="${tag#v}"
version="$(deno eval --quiet --allow-read 'console.log(JSON.parse(Deno.readTextFileSync(\"deno.json\")).version)')"
if [[ "${tag}" != "${version}" ]]; then
echo "Tag (${GITHUB_REF_NAME}) does not match deno.json version (${version})."
exit 1
fi
- name: Format / Lint / Test
run: |
deno fmt --check
deno lint
deno task test
- name: Publish
run: |
# Tokenless publishing requires linking the JSR package to this GitHub repository
# in the package settings on jsr.io, and OIDC enabled via `id-token: write`.
deno publish