diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 739a451..76f4caa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -383,6 +383,9 @@ jobs: environment: BrowserStackEnv permissions: contents: read + # npm trusted publishing (OIDC): npm exchanges this token for a + # short-lived publish credential, so no long-lived NPM token is stored. + id-token: write outputs: published: ${{ steps.check-version.outputs.already_published == 'false' }} version: ${{ steps.get-version.outputs.version }} @@ -405,6 +408,10 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + # Trusted publishing needs npm >= 11.5.1 (pnpm publish delegates to npm). + - name: Upgrade npm for trusted publishing + run: npm install -g npm@^11.5.1 + - name: Download build artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: @@ -433,9 +440,7 @@ jobs: TAG="latest" fi echo "Publishing version $VERSION with tag $TAG" - pnpm publish -r --tag $TAG --no-git-checks - env: - NODE_AUTH_TOKEN: "${{ secrets.NPM_PUBLISH_TOKEN }}" + pnpm publish -r --tag $TAG --no-git-checks --provenance # ── 6. Create GitHub Release (main branch only, if published) ──────────────── release: diff --git a/packages/accessibility/package.json b/packages/accessibility/package.json index 0f5b94a..91e4089 100644 --- a/packages/accessibility/package.json +++ b/packages/accessibility/package.json @@ -38,5 +38,10 @@ "tsup": "^8.5.1", "typescript": "^6.0.3", "vitest": "^4.1.4" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/accessibility" } } diff --git a/packages/app-automate/package.json b/packages/app-automate/package.json index 51b09ee..81e9e18 100644 --- a/packages/app-automate/package.json +++ b/packages/app-automate/package.json @@ -66,5 +66,10 @@ "vitest": { "optional": true } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/app-automate" } } diff --git a/packages/automate/package.json b/packages/automate/package.json index 7d688e8..d8b0ab2 100644 --- a/packages/automate/package.json +++ b/packages/automate/package.json @@ -65,5 +65,10 @@ "vitest": { "optional": true } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/automate" } } diff --git a/packages/core/package.json b/packages/core/package.json index 80b39d2..98a2263 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,5 +37,10 @@ "@types/node": "20.0.0", "tsup": "^8.5.1", "typescript": "^6.0.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/core" } } diff --git a/packages/local-testing-binary/package.json b/packages/local-testing-binary/package.json index 76df17c..e3e02c9 100644 --- a/packages/local-testing-binary/package.json +++ b/packages/local-testing-binary/package.json @@ -35,5 +35,10 @@ "@types/node": "20.0.0", "tsup": "^8.5.1", "typescript": "^6.0.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/local-testing-binary" } } diff --git a/packages/local-testing/package.json b/packages/local-testing/package.json index 7599967..3bc0e0f 100644 --- a/packages/local-testing/package.json +++ b/packages/local-testing/package.json @@ -50,5 +50,10 @@ "typescript": "^6.0.3", "vitest": "^4.1.4", "zod": "^4.4.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/local-testing" } } diff --git a/packages/screenshots/package.json b/packages/screenshots/package.json index d9beb0a..a9bd90e 100644 --- a/packages/screenshots/package.json +++ b/packages/screenshots/package.json @@ -48,5 +48,10 @@ "typescript": "^6.0.3", "vitest": "^4.1.4", "zod": "^4.4.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/screenshots" } } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 745a6b7..51f28a4 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -84,5 +84,10 @@ "devDependencies": { "tsup": "^8.5.1", "typescript": "^6.0.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/sdk" } } diff --git a/packages/test-management/package.json b/packages/test-management/package.json index 0b247e7..fe79cbe 100644 --- a/packages/test-management/package.json +++ b/packages/test-management/package.json @@ -38,5 +38,10 @@ "tsup": "^8.5.1", "typescript": "^6.0.3", "vitest": "^4.1.4" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/test-management" } } diff --git a/packages/test-reporting/package.json b/packages/test-reporting/package.json index 80ed1c5..408d55b 100644 --- a/packages/test-reporting/package.json +++ b/packages/test-reporting/package.json @@ -51,5 +51,10 @@ "zod": { "optional": true } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/test-reporting" } } diff --git a/packages/website-scanner/package.json b/packages/website-scanner/package.json index e319294..5ccd08b 100644 --- a/packages/website-scanner/package.json +++ b/packages/website-scanner/package.json @@ -38,5 +38,10 @@ "tsup": "^8.5.1", "typescript": "^6.0.3", "vitest": "^4.1.4" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shirish87/browserstack-client.git", + "directory": "packages/website-scanner" } }