Merge pull request #189 from jeswanke/ACM-20347-difficult-to-edit-yaml2 #183
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: NPM Publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- src/** | |
workflow_dispatch: | |
inputs: | |
versionIncrement: | |
description: Version Increment | |
required: true | |
default: minor | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
npm-publish: | |
runs-on: ubuntu-latest | |
concurrency: repository | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
registry-url: https://registry.npmjs.org/ | |
cache: 'npm' | |
- name: npm version ${{ inputs.versionIncrement || 'minor' }} | |
run: | | |
TAG=$(npm version ${{ inputs.versionIncrement || 'minor' }} --no-git-tag-version) | |
echo "TAG=$(echo $TAG)" >> $GITHUB_ENV | |
- run: npm ci | |
- run: npm run build | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: Release ${{ env.TAG }} [skip ci] | |
tag: ${{ env.TAG }} | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm run pages | |
- uses: JamesIves/github-pages-deploy-action@4.1.5 | |
with: | |
branch: gh-pages | |
folder: dist | |
single-commit: true |