Skip to content

Release tag before publish #7

Release tag before publish

Release tag before publish #7

Workflow file for this run

name: Release tag before publish
on: workflow_dispatch
jobs:
release-tag:
name: Create new release tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
fetch-depth: 0
fetch-tags: true
- name: Bump version
run: |
if git diff --exit-code master -- CHANGELOG.md; then
message='Unable to find actual changes in CHANGELOG.md. Do proper changes and rerun this job!'
echo "::error file={name},line={line},endLine={endLine},title={title}::${message}"
exit 1
fi
prevVer=$(node -p "require('./package.json').version")
echo "Current version: $prevVer"
msgs=$(git log --oneline $(git describe --tags --abbrev=0)..HEAD)
echo ${msgs,,}
if [[ ${msgs,,} =~ ^(fix|refactoring) ]]; then
npm --no-git-tag-version version patch
else
echo "no 'fix' or 'refactoring' commit message found.."
fi
if [[ ${msgs,,} =~ ^(feat) ]]; then
npm --no-git-tag-version version minor
else
echo "no 'feat' commit meassage found.."
fi
if [[ ${msgs,,} =~ ^(breaking change|!) ]]; then
npm --no-git-tag-version version patch
else
echo "no 'BREAKING CHANGE' or '!' found.."
fi
newVer=$(node -p "require('./package.json').version")
if [[ "$prevVer" == "$newVer" ]]; then
message='Unable to find actual version changes. Did you use proper conventional commit messages?'
echo "::error file={name},line={line},endLine={endLine},title={title}::${message}"
exit 1
fi
#clean
rm debugger/*.lua; rm debugger/*.lua.map; rm extension/*.js; rm extension/*.js.map; rm *.vsix
npm lint
npm build
npm bundle