π Improve config error logging (#396) #4
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: Auto Tag Release on Version Change | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- "package.json" | |
jobs: | |
auto-tag: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Get version from package.json | |
id: get_version | |
run: | | |
VERSION=$(jq -r .version package.json) | |
if ! git ls-remote --tags origin | grep -q "refs/tags/v${VERSION}"; then | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "Version found: $VERSION" | |
else | |
echo "Version already exists: $VERSION" | |
fi | |
- name: Create Git Tag | |
if: steps.get_version.outputs.version != '' | |
run: | | |
git tag v${{ steps.get_version.outputs.version }} | |
git push origin v${{ steps.get_version.outputs.version }} | |
- name: Create GitHub Release | |
if: steps.get_version.outputs.version != '' | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
name: Release v${{ steps.get_version.outputs.version }} | |
body: | | |
https://github.com/${{ github.repository }}/commit/${{ github.sha }} | |
See [CHANGELOG.md](./CHANGELOG.md) for details. | |
draft: false | |
prerelease: ${{ contains(steps.get_version.outputs.version, 'alpha') || contains(steps.get_version.outputs.version, 'beta') || contains(steps.get_version.outputs.version, 'rc') }} |