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

ci: auto-publish to jsr #8

Merged
merged 2 commits into from
Dec 20, 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
5 changes: 5 additions & 0 deletions .changeset/perfect-dodos-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
formgator: patch
---

Auto-publish to JSR
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: changesets/action@v1
with:
title: "chore: release packages"
version: bash ./changeset-version.sh
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 1 addition & 3 deletions changeset-version.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env bash
# This script is currently unused as Node hangs running "changeset version" on GitHub
set -euxo pipefail

# Changeset runs git reset --hard, so we need to reinstall dependencies
yarn install --immutable

# Update package.json and produce the changelog
# (yarn hangs, use node instead)
yarn dlx changeset version
yarn changeset version

# Keep jsr.json in sync with package.json
yarn node -e 'fs.writeFileSync("jsr.json",fs.readFileSync("jsr.json","utf8").replace(/"version": ".+"/,`"version": "${process.env.npm_package_version}"`))'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"check": "yarn workspaces foreach -W run check",
"dev": "pkgroll --sourcemap --watch",
"lint": "biome check --fix",
"release": "yarn build && yarn changeset publish",
"release": "yarn build && yarn changeset publish && yarn dlx jsr publish",
"test": "tsc --noEmit && tsx --experimental-test-coverage --experimental-test-isolation=none --test-coverage-exclude='src/**/*.test.ts' --test-coverage-branches=100 --test 'src/**/*.test.ts'"
},
"devDependencies": {
Expand Down
Loading