Build, Release and Publish #25
This file contains hidden or 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: Build, Release and Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
bump: | |
description: "bump type, major or minor or patch or empty string" | |
default: "" | |
required: false | |
dry_run: | |
description: "dry run, true or false" | |
default: "false" | |
required: true | |
draft: | |
description: "draft, true or false" | |
default: "false" | |
required: true | |
pre_release: | |
description: "pre release, true or false" | |
default: "false" | |
required: true | |
jobs: | |
release: | |
name: Release & Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: 18.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} | |
- name: Build | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: npm install | |
- uses: MeilCli/bump-release-action@v1 | |
with: | |
config_path: ".github/bump.yml" | |
bump: ${{ github.event.inputs.bump }} | |
dry_run: ${{ github.event.inputs.dry_run }} | |
draft: ${{ github.event.inputs.draft }} | |
pre_release: ${{ github.event.inputs.pre_release }} | |
- name: "Publish to NPM" | |
if: github.event.inputs.dry_run != 'true' | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} |