Skip to content

Commit

Permalink
Fixing publish to npm with pnpm (#192)
Browse files Browse the repository at this point in the history
Because apparently pnpm config set just silently make the default
script: batch crash without an error
  • Loading branch information
timotheeguerin authored Jan 31, 2024
1 parent 148eee4 commit b53e3dd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .changeset/big-frogs-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion core
25 changes: 17 additions & 8 deletions eng/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ jobs:

- template: ./templates/upload-coverage.yml

- script: |
pnpm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
pnpm -r publish --access public --no-git-checks
displayName: Publish packages
- pwsh: |
echo "Updating config"
pnpm config set '//registry.npmjs.org/:_authToken' '${NPM_AUTH_TOKEN}'
echo "Publishing"
pnpm -r --filter='./packages/*' publish --access public --no-git-checks
name: Publish
env:
NPM_AUTH_TOKEN: $(azure-sdk-npm-token)
- task: AzureCLI@1
displayName: "Publish bundled packages to package storage"
Expand Down Expand Up @@ -84,12 +88,17 @@ jobs:
- template: ./templates/install.yml
parameters:
nodeVersion: "20.x"

- template: ./templates/build.yml

- script: node ./core/packages/internal-build-utils/cmd/cli.js bump-version-preview .
displayName: Bump version to prerelease targets

- script: |
pnpm config set //registry.npmjs.org/:_authToken=$(azure-sdk-npm-token)
pnpm -r publish --access public --no-git-checks --tag next
displayName: Publish packages
- pwsh: |
echo "Updating config"
pnpm config set '//registry.npmjs.org/:_authToken' '${NPM_AUTH_TOKEN}'
echo "Publishing"
pnpm -r --filter='./packages/*' publish --access public --no-git-checks --tag next
name: Publish
env:
NPM_AUTH_TOKEN: $(azure-sdk-npm-token)
1 change: 1 addition & 0 deletions packages/typespec-service-csharp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@azure-tools/typespec-service-csharp",
"version": "0.32.0",
"private": true,
"description": "Azure TypeSpec service code generator for c-sharp",
"homepage": "https://azure.github.io/typespec-azure",
"readme": "https://github.com/Azure/typespec-azure/blob/main/packages/typespec-service-csharp/README.md",
Expand Down

0 comments on commit b53e3dd

Please sign in to comment.