Skip to content

Commit

Permalink
feat: add jsr.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed May 29, 2024
1 parent 39e9d91 commit 90003c7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ on:
branches: [ main ]

jobs:
build:

check_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: "1.41.3"
- run: deno run --allow-read version-check.ts

build:
runs-on: ubuntu-latest
needs: [check_versions]
strategy:
matrix:
node-version: [ 18.x, 20.x ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: "9.x"
Expand All @@ -41,3 +48,13 @@ jobs:
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

publish:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
5 changes: 5 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@jmondi/oauth2-server",
"version": "3.3.0",
"exports": "./src/index.ts"
}
9 changes: 9 additions & 0 deletions version-check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import jsr from "./jsr.json" assert { type: "json" };
import pkg from "./package.json" assert { type: "json" };

if (jsr.version !== pkg.version) {
console.error("Version Mismatch");
console.error("JSR: ", jsr.version);
console.error("Node:", pkg.version);
Deno.exit(1);
}

0 comments on commit 90003c7

Please sign in to comment.