Publish new version of package #5
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: Publish new version of package | |
on: | |
workflow_dispatch: | |
inputs: | |
version-type: | |
type: choice | |
required: true | |
default: patch | |
description: New version type | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout master branch with history for diffing | |
uses: actions/checkout@v3 | |
with: | |
ref: 'refs/heads/master' | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Configure Git | |
run: | | |
git config user.name "cloudinary-bot" | |
git config user.email "[email protected]" | |
- name: Install dependencies | |
run: npm ci | |
- name: Bump version | |
run: npm version ${{ github.event.inputs.version-type }} -m "Bumping to version %s" --tag-version-prefix="" | |
- name: Build | |
shell: bash | |
run: npm run build | |
- name: Publish packages | |
run: npm publish --access="public" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push changes | |
run: git push --tags --set-upstream origin master --force |