-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.22 KB
/
publish.yaml
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
name: Publish
on:
push:
branches:
- main
jobs:
publish-jsr:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Publish package
run: npx jsr publish
publish-npm:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x # Run with latest stable Deno.
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- uses: actions/checkout@v4
- name: Build for NPM
run: deno task build:npm
- name: Publish to npm
run: |
cd dist-npm
PACKAGE_NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
if npm view "$PACKAGE_NAME@$VERSION" > /dev/null 2>&1; then
echo "Version $VERSION of $PACKAGE_NAME already exists, skipping publish."
else
echo "Publishing version $VERSION of $PACKAGE_NAME"
npm publish --provenance --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.FISHBALLPKG_NPM_TOKEN }}