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}}
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@08eba0b27e820071cde6df949e0beb9ba4906955
with:
ref: 'main'
fetch-depth: 0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
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 }}