webdriverio/.github/workflows/publish.yml
2025-06-17 22:33:12 -07:00

70 lines
2.2 KiB
YAML

name: Manual NPM Publish
on:
workflow_dispatch:
inputs:
releaseType:
description: "Release Type"
required: true
type: choice
default: "patch"
options:
- patch
- minor
- major
- premajor
distTag:
description: 'NPM tag (e.g. use "next --canary" to release a test version, add "--force-publish" to release all packages)'
required: true
default: 'latest'
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
# disable provenance check as it stopped working with Lerna:
# > lerna ERR! E422 Error verifying sigstore provenance bundle: Failed to validate the provenance
# > subject against the package name, version and tarball integrity. Please try re-publishing with
# > the latest stable version of npm
# NPM_CONFIG_PROVENANCE: true
jobs:
authorize:
name: Authorize Actor
uses: ./.github/workflows/authorize.yml
secrets: inherit
release:
permissions:
contents: write
id-token: write
packages: read
needs: [authorize]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: 'main'
fetch-depth: 0
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: NPM Setup
run: |
npm set registry "https://registry.npmjs.org/"
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm whoami
- name: Git Setup
run: |
git config --global user.email "bot@webdriver.io"
git config --global user.name "WebdriverIO Release Bot"
- name: Install Dependencies
run: pnpm install
- name: Release
run: |
pnpm run setup
pnpm -r --filter=@wdio/lerna-patch run patch
pnpm lerna publish ${{github.event.inputs.releaseType}} --exact --yes --dist-tag ${{github.event.inputs.distTag}}
pnpm run pushReleaseTag
env:
NODE_ENV: production
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}