diff --git a/.changeset/config.json b/.changeset/config.json index fce1c26..1d44fe4 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,8 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": [], + "snapshot": { + "useCalculatedVersion": true + } } diff --git a/.changeset/port-upstream-service-parity.md b/.changeset/port-upstream-service-parity.md new file mode 100644 index 0000000..846336b --- /dev/null +++ b/.changeset/port-upstream-service-parity.md @@ -0,0 +1,5 @@ +--- +"@wdio/browserstack-service": minor +--- + +Publish from the standalone `browserstack/wdio-browserstack-service` repo, at parity with the WebdriverIO monorepo. Includes Load Testing Service (LTS) support, one-to-many Test-Case-ID tagging (`setCustomTestCaseId`), correct test/hook finish on mocha timeouts, per-batch failure isolation in the request queue, accessibility Browser type augmentations, and `yauzl` upgraded to `^3.4.0`. No user-facing API change. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cac6a58..12aa288 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,29 @@ name: Release # # The gRPC/protobuf client is generated inline at build time (buf generate); there is no # separate core package for this workflow to version or publish. +# +# Release model (publishing is MANUAL): +# * push to main / v8 -> opens/updates the "Version Packages" PR only. NEVER publishes; +# merging that PR does NOT publish either. +# * Run workflow (publish) -> publishes the merged version to npm (main -> `latest`, +# v8 -> `v8`) with git tag + GitHub release + provenance. +# * Run workflow (canary) -> snapshot prerelease to the npm `canary` dist-tag. on: push: branches: - - main # v9 line -> dist-tag "latest" - - v8 # v8 line -> dist-tag "v8" (from publishConfig.tag on the v8 branch) + - main # v9 line -> opens Version PR (publish target: dist-tag "latest") + - v8 # v8 line -> opens Version PR (publish target: dist-tag "v8" via publishConfig.tag) + workflow_dispatch: + inputs: + publish: + description: 'Publish the merged version to npm (main -> `latest`, v8 -> `v8`). Merge the "Version Packages" PR first so there are no pending changesets.' + type: boolean + default: false + canary: + description: 'Publish a canary prerelease to the npm `canary` dist-tag (validates OIDC + provenance end-to-end; never touches `latest`). Requires at least one pending changeset.' + type: boolean + default: false # Never run main and v8 releases on top of each other. concurrency: release-${{ github.ref }} @@ -42,8 +59,6 @@ jobs: # NODE_AUTH_TOKEN that becomes an empty token line that can shadow OIDC Trusted # Publishing at `npm publish` time. npm already defaults to registry.npmjs.org and # publishConfig.access=public handles the scoped publish, so the line isn't needed. - # (Follow-up to consider: split changesets/action so publish runs as its own - # top-level step — further de-risks OIDC. Tracked, not done here.) uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 # resolves to >= 22.14 on the runner (OIDC floor) @@ -63,13 +78,44 @@ jobs: - name: Test run: npm test - - name: Create Release PR or publish to npm + # Version PR (push to main / v8): run changesets in VERSION-ONLY mode — open or update the + # "Version Packages" PR (version bump + CHANGELOG). This step NEVER publishes: with no + # `publish:` input, once the Version PR is merged (a push with no pending changesets) the + # action simply no-ops. Publishing is the separate, manual step below. + - name: Open/update the "Version Packages" PR + if: github.event_name == 'push' + uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1 + with: + version: npm run version # changeset version — manages the Version PR only + createGithubReleases: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Publish (manual, workflow_dispatch with publish=true): publish the already-versioned + # package to npm — main -> `latest`, v8 -> `v8` (via publishConfig.tag) — with git tag, + # GitHub release, and provenance, over the OIDC trusted publisher (no NPM_TOKEN). + # Merge the "Version Packages" PR first: this publishes only when there are no pending + # changesets. If any remain, the action safely opens/updates the Version PR instead. + - name: Publish to npm + if: github.event_name == 'workflow_dispatch' && inputs.publish uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1 with: - version: npm run version # changeset version (opens the "Version Packages" PR) publish: npm run release # changeset publish (honors publishConfig.tag per branch) createGithubReleases: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # No NPM_TOKEN: auth is OIDC via id-token: write above. NPM_CONFIG_PROVENANCE: 'true' + + # Canary (manual, workflow_dispatch with canary=true): snapshot-version the pending + # changesets and publish a prerelease to the `canary` dist-tag via the SAME OIDC trusted + # publisher. Validates OIDC + provenance end-to-end without touching `latest`. + # snapshot.useCalculatedVersion=true in .changeset/config.json makes the version + # -canary- (e.g. 9.30.0-canary-...). Requires >=1 pending changeset. + - name: Canary publish to `canary` dist-tag + if: github.event_name == 'workflow_dispatch' && inputs.canary + run: | + npx changeset version --snapshot canary + npx changeset publish --no-git-tag --tag canary + env: + NPM_CONFIG_PROVENANCE: 'true' diff --git a/packages/browserstack-service/package.json b/packages/browserstack-service/package.json index 2651bd0..5ad6aa2 100644 --- a/packages/browserstack-service/package.json +++ b/packages/browserstack-service/package.json @@ -1,6 +1,6 @@ { "name": "@wdio/browserstack-service", - "version": "9.28.0", + "version": "9.29.1", "description": "WebdriverIO service for better Browserstack integration", "author": "BrowserStack ", "homepage": "https://github.com/browserstack/wdio-browserstack-service",