Manual NPM Publish #31
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 | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v2 | |
- name: Setup Node version | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm ci | |
- run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Upload built package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: compiled-package | |
path: build/ | |
release: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v2 | |
- name: Setup Node version | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
- name: Setup Git | |
run: | | |
git config --global user.email "bot@webdriver.io" | |
git config --global user.name "WebdriverIO Release Bot" | |
- name: Install dependencies | |
run: npm ci | |
- name: Download built package | |
uses: actions/download-artifact@v2 | |
with: | |
name: compiled-package | |
path: build/ | |
- name: Release | |
run: | | |
npm pack --dry-run | |
npm run release:ci -- ${{github.event.inputs.releaseType}} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |