Skip to content

Commit 6e4919f

Browse files
authored
Merge pull request #725 from MasterKale/feat/automated-publishing
Add new Server publish workflow
2 parents 75ad6b7 + 7dc59ec commit 6e4919f

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish to JSR and NPM?
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: read
12+
id-token: write # The OIDC ID token is used for authentication with JSR.
13+
14+
env:
15+
NODE_VERSION: '22.x'
16+
DENO_VERSION: 'v2.4.x'
17+
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
# Install Node
22+
- name: Setup Node.js ${{ env.NODE_VERSION }}
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
registry-url: 'https://registry.npmjs.org'
27+
- name: Confirm installed Node version
28+
run: node -v
29+
30+
# Install Deno
31+
- name: Setup Deno ${{ env.DENO_VERSION }}
32+
uses: denoland/setup-deno@v2
33+
with:
34+
deno-version: ${{ env.DENO_VERSION }}
35+
- name: Confirm installed Deno version
36+
run: deno -V
37+
38+
# Set up caching for quicker installs
39+
- name: Get DENO_DIR store directory
40+
shell: bash
41+
# Expecting "DENO_DIR location: /Users/matt/Library/Caches/deno" somewhere in `deno info`
42+
run: |
43+
echo "DENO_DIR=$(deno info | grep "DENO_DIR" | awk '{print $3}')" >> $GITHUB_ENV
44+
- name: Setup Deno cache
45+
uses: actions/cache@v4
46+
with:
47+
path: ${{ env.DENO_DIR }}
48+
key: ${{ runner.os }}-deno-dir-${{ hashFiles('**/deno.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-deno-dir-
51+
52+
# Install deps
53+
- name: Install dependencies
54+
run: deno install
55+
56+
# Publish to JSR and NPM
57+
- name: Publish to JSR and NPM
58+
run: deno task publish:server
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)