Skip to content

chore(release): 0.1.2 (#41) #4

chore(release): 0.1.2 (#41)

chore(release): 0.1.2 (#41) #4

name: Release Next Version
on:
push:
branches: [main]
paths: ["VERSION"]
jobs:
release:
name: "Tag Release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- id: check-out
name: "Check out code"
uses: actions/checkout@v3
- id: current-tag
name: "Check latest tag"
run: |
version="$(cat VERSION)"
echo "version=${version}" >> "${GITHUB_OUTPUT}"
if git rev-parse "v${version}" >/dev/null 2>&1; then
echo "exists=true" >> "${GITHUB_OUTPUT}"
fi
- id: create-tag
name: Create release tag
if: steps.current-tag.outputs.exists != 'true'
run: |
set -x
version=${{ steps.current-tag.outputs.version }}
tag="v${version}"
msg="Release ${version}"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a -m "${msg}" "${tag}"
git push origin "${tag}"