Skip to content

Commit

Permalink
Fix canary release (#90)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
johnnyomair authored Aug 6, 2024
1 parent 906ab7e commit 0796580
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0796580

Please sign in to comment.