[GEN-1028] feat: add overview metrics (#25) #36
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 NPM Package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: Configure Git | |
run: | | |
git config --global user.name alonkeyval | |
git config --global user.email alon@keyval.dev | |
- name: Install Dependencies | |
run: yarn install | |
- name: Get Latest Commit Message | |
id: commit_message | |
run: echo "::set-output name=message::$(git log -1 --pretty=%B)" | |
- name: Determine Version Bump | |
id: version_bump | |
run: | | |
commit_message="${{ steps.commit_message.outputs.message }}" | |
if [[ $commit_message == *"BREAKING CHANGE"* ]]; then | |
echo "::set-output name=bump::major" | |
elif [[ $commit_message == *feat:* ]]; then | |
echo "::set-output name=bump::minor" | |
else | |
echo "::set-output name=bump::patch" | |
fi | |
- name: Bump Package Version | |
run: | | |
version_bump="${{ steps.version_bump.outputs.bump }}" | |
npm version $version_bump --no-git-tag-version | |
- name: Publish to NPM | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |