From 40c4b1f284dca225799590d524b3eb5ce3aa2f16 Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Mon, 22 Apr 2024 15:59:25 -0700 Subject: [PATCH] chore: Allow dirty for jsr publish. (#443) 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" ``` --- .github/workflows/manual-publish.yml | 1 + scripts/publish-jsr.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index d0869f963..2a922f529 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -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" diff --git a/scripts/publish-jsr.sh b/scripts/publish-jsr.sh index 0862a8252..9d6634d0b 100755 --- a/scripts/publish-jsr.sh +++ b/scripts/publish-jsr.sh @@ -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."