Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: enable publishing to jsr #26

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# coverageLocations: |
# ${{github.workspace}}/target/coverage/lcov.info:lcov

- name: Semantic Release
- name: Semantic Release (npm)
if: github.ref == 'refs/heads/main'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -72,6 +72,11 @@ jobs:
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: npm_config_yes=true npx zx-semrel
- name: jsr publish
if: github.ref == 'refs/heads/main'
run: |
node src/scripts/build-jsr.mjs
npx jsr publish

pr:
if: github.event_name == 'pull_request'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target/*
!target/esm/
!target/dts/
typings
jsr.json

# Temp assets
.temp
Expand Down
18 changes: 18 additions & 0 deletions src/scripts/build-jsr.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import fs from 'fs'
import path from 'path'
const cwd = process.cwd()
const pkgJson = JSON.parse(fs.readFileSync(path.resolve(cwd, 'package.json'), 'utf-8'))

fs.writeFileSync(path.resolve(cwd, 'jsr.json'), JSON.stringify({
name: '@webpod/zurk',
version: pkgJson.version,
exports: {
'.': './src/main/ts/index.ts',
'./spawn': './src/main/ts/spawn.ts',
'./util': './src/main/ts/util.ts',
'./zurk': './src/main/ts/zurk.ts'
},
publish: {
include: ['src/main/ts']
}
}, null, 2))
Loading