-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.37 KB
/
publish.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
43
44
45
46
47
48
49
50
51
52
name: Publish
on:
push:
branches:
- main
jobs:
test:
name: Test
uses: ./.github/workflows/tests.yml
secrets: inherit
permissions:
contents: read
id-token: write
release:
name: Release
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install jq
uses: dcarbone/install-jq-action@v2
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: Release on GitHub
run: pnpm --package conventional-changelog-conventionalcommits --package semantic-release dlx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update version for JSR registry
run: |
VERSION=$(node -p "require('./package.json').version")
jq --arg version "$VERSION" '.version = $version' jsr.json > jsr.json.tmp
mv jsr.json.tmp jsr.json
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Publish package to JSR
if: env.VERSION != '0.0.0-development'
run: pnpm dlx jsr publish