ci: Add CalVer auto-tagging to deploy workflow #2

Merged
cal merged 2 commits from chore/optimize-claude-md into main 2026-02-18 17:33:29 +00:00

View File

@ -10,6 +10,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for tag counting
# Generate CalVer: YYYY.MM.BUILD
# BUILD = count of tags matching current month + 1
- name: Generate CalVer version
id: meta
run: |
YEAR=$(date -u +%Y)
MONTH=$(date -u +%-m)
PREFIX="${YEAR}.${MONTH}."
git fetch --tags
BUILD=$(git tag -l "${PREFIX}*" | wc -l)
BUILD=$((BUILD + 1))
VERSION="${PREFIX}${BUILD}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "CalVer version: ${VERSION}"
- name: Setup Node.js
uses: actions/setup-node@v4
@ -42,3 +61,14 @@ jobs:
script: |
chown -R 1000:1000 /opt/foundry/data/Data/systems/vagabond/
cd /opt/foundry && docker compose restart foundry
# Create git tag via Gitea API (avoids branch protection issues)
- name: Tag release
if: success()
run: |
curl -s -X POST \
-H "Authorization: token ${{ github.token }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${{ steps.meta.outputs.version }}\", \"target\": \"${{ github.sha }}\", \"name\": \"${{ steps.meta.outputs.version }}\"}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/tags"
echo "Created tag ${{ steps.meta.outputs.version }}"