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 dddfd07
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,28 @@ on:
branches: [ main ]

jobs:
build:

check_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
jsr_version=$(jq -r '.version' jsr.json)
pkg_version=$(jq -r '.version' package.json)
if [[ "$jsr_version" != "$pkg_version" ]]; then
echo "Version Mismatch"
echo "JSR: $jsr_version"
echo "Node: $pkg_version"
exit 1
fi
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 +53,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"
}
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"rootDir": "./src"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "test", "dist", "test/**/*.spec.ts", "example"]
"exclude": ["node_modules", "test", "dist", "test/**/*.spec.ts", "example", "version-check.ts"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["example", "coverage", "dist", "node_modules"]
"exclude": ["example", "coverage", "dist", "node_modules", "version-check.ts"]
}
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default defineConfig({
exclude: [".github/**", ".idea/**", "docs/**", "example/**"],
},
setupFiles: ["test/setup.ts"],
exclude: ["node_modules/**", "example/**"],
exclude: ["node_modules/**", "example/**", "version-check.ts"],
},
});

0 comments on commit dddfd07

Please sign in to comment.