Skip to content

Commit

Permalink
chore: Allow dirty for jsr publish. (#443)
Browse files Browse the repository at this point in the history
The root cause is .yarnrc.yml being modified because of the addition of
npmRegistryServer:

```shell
Publishing jsr: @launchdarkly/cloudflare-server-sdk
diff --git a/.yarnrc.yml b/.yarnrc.yml
index 5a857be..7cbcb75 100644
--- a/.yarnrc.yml
+++ b/.yarnrc.yml
@@ -4,10 +4,14 @@ npmPublishAccess: public
 
 npmScopes:
   jsr:
-    npmRegistryServer: 'https://npm.jsr.io/'
+    npmRegistryServer: "https://npm.jsr.io/"
+  launchdarkly:
+    npmAlwaysAuth: true
+    npmAuthToken: ***
+    npmRegistryServer: "https://registry.npmjs.org/"
 
 plugins:
   - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
-    spec: '@yarnpkg/plugin-workspace-tools'
+    spec: "@yarnpkg/plugin-workspace-tools"
```
  • Loading branch information
yusinto authored Apr 22, 2024
1 parent 1587216 commit 40c4b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
- name: Setup .yarnrc.yml
if: ${{ inputs.package_registry == 'npm' }}
shell: bash
run: |
yarn config set npmScopes.launchdarkly.npmRegistryServer "https://registry.npmjs.org"
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-jsr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if [ -f "./$WORKSPACE_PATH/jsr.json" ]; then

if $LD_RELEASE_IS_DRYRUN ; then
echo "Doing a dry run of jsr publishing."
npx jsr publish --dry-run || { echo "jsr publish failed" >&2; exit 1; }
npx jsr publish --dry-run --allow-dirty || { echo "jsr publish failed" >&2; exit 1; }
elif [ -f "./$WORKSPACE_PATH/jsr.json" ]; then
echo "Publishing to jsr."
npx jsr publish || { echo "jsr publish failed" >&2; exit 1; }
npx jsr publish --allow-dirty || { echo "jsr publish failed" >&2; exit 1; }
fi
else
echo "Skipping jsr."
Expand Down

0 comments on commit 40c4b1f

Please sign in to comment.