From 0796580bad119a378edd0240df95c44fc61b8e47 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:30:49 +0200 Subject: [PATCH] Fix canary release (#90) Apparently, NPM calls the publish script when running `npm publish`, resulting in trying to publish the same package twice. We remove the publish script in an attempt to fix it. See https://stackoverflow.com/questions/71730319/npm-attempts-to-publish-twice for more information. --- .github/workflows/release-canary.yml | 3 ++- .github/workflows/release.yml | 2 +- package.json | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml index db55c88..4189673 100644 --- a/.github/workflows/release-canary.yml +++ b/.github/workflows/release-canary.yml @@ -34,6 +34,7 @@ jobs: echo >> .changeset/canary.md echo fake change to always get a canary release >> .changeset/canary.md yarn changeset version --snapshot canary - yarn run publish --tag canary + yarn build + yarn changeset publish --tag canary env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6aeeea..c34b9e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: id: changesets uses: changesets/action@v1 with: - publish: yarn publish + publish: yarn build && yarn changeset publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 019bb1b..98d7164 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "lint:eslint": "eslint src/", "lint:tsc": "tsc", "build": "tsc", - "start": "tsc --watch", - "publish": "yarn build && yarn changeset publish" + "start": "tsc --watch" }, "repository": { "type": "git",