Skip to content

[v0.1.24] - Update dependencies and bump version #214

[v0.1.24] - Update dependencies and bump version

[v0.1.24] - Update dependencies and bump version #214

Workflow file for this run

name: Create Release on Push to Main
on: push
jobs:
build:
name: 🆙 Update and Publish Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Keegan Cruickshank"
- name: Extract version from commit message
id: extract-version
run: |
commit_message=$(git log -1 --pretty=%B)
if [[ $commit_message =~ \[v([0-9]+\.[0-9]+\.[0-9]+)\] ]]; then
version="${BASH_REMATCH[1]}"
echo "version=v$version" >> $GITHUB_OUTPUT
else
echo "No version found in commit message. Exiting."
exit 1
fi
- name: Update npm package
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Create new tag
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ steps.extract-version.outputs.version }}
message: "${{ steps.extract-version.outputs.version }}"
- name: Update package version
run: npm version ${{ steps.extract-version.outputs.version }} --no-git-tag-version
- name: Install dependencies
run: yarn install
- name: Publish to NPM
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}