Manual NPM Publish #519
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | |
NPM_CONFIG_PROVENANCE: true | |
jobs: | |
authorize: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: octokit/request-action@v2.2.0 | |
with: | |
route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }} | |
team: technical-steering-committee | |
organisation: webdriverio | |
env: | |
GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }} | |
release: | |
permissions: | |
contents: write | |
id-token: write | |
needs: [authorize] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'main' | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v4 | |
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 run generate:typings | |
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 }} |