Skip to content

Merge branch 'main' of https://github.com/chess-labs/core #8

Merge branch 'main' of https://github.com/chess-labs/core

Merge branch 'main' of https://github.com/chess-labs/core #8

Workflow file for this run

name: Auto Tag Release
on:
push:
branches: [main]
paths:
- 'package.json'
jobs:
auto-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GA_TOKEN }}
- name: Get current version
id: current-version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Current version: $VERSION"
- name: Check if tag exists
id: check-tag
run: |
VERSION="${{ steps.current-version.outputs.version }}"
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Tag v$VERSION already exists"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Tag v$VERSION does not exist"
fi
- name: Create and push tag
if: steps.check-tag.outputs.exists == 'false'
run: |
VERSION="${{ steps.current-version.outputs.version }}"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Create annotated tag
git tag -a "v$VERSION" -m "Release v$VERSION"
git push origin "v$VERSION"
echo "✅ Created and pushed tag v$VERSION"
- name: Create GitHub Release
if: steps.check-tag.outputs.exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GA_TOKEN }}
with:
tag_name: v${{ steps.current-version.outputs.version }}
release_name: Release v${{ steps.current-version.outputs.version }}
body: |
🚀 **Release v${{ steps.current-version.outputs.version }}**
## What's Changed
Check the [CHANGELOG.md](https://github.com/chess-labs/chessboard/blob/main/CHANGELOG.md) for detailed changes.
**Full Changelog**: https://github.com/chess-labs/chessboard/compare/v${{ steps.current-version.outputs.version }}...HEAD
draft: false
prerelease: false