Manual NPM Publish #51
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 - major, minor or patch' | |
required: true | |
default: 'patch' | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}} | |
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}} | |
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: 14 | |
- 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: 14 | |
registry-url: https://registry.npmjs.org/ | |
- name: Setup Git | |
run: | | |
git config --global user.name "oss-sauce-bot" | |
git config --global user.email "[email protected]" | |
- name: Install dependencies | |
run: npm ci | |
- name: Download built package | |
uses: actions/download-artifact@v2 | |
with: | |
name: compiled-package | |
- name: Release | |
run: npm run release:ci -- ${{github.event.inputs.releaseType}} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |