Skip to content

Manual NPM Publish

Manual NPM Publish #42

Workflow file for this run

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}}
NPM_CONFIG_PROVENANCE: true
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
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}}