claude-prism/.github/workflows/covector-version-or-publish.yml
delibae bb80c99271 fix: trigger build workflow via workflow_dispatch after covector publish
GITHUB_TOKEN tag pushes don't trigger other workflows (GitHub limitation).
Use gh workflow run to explicitly trigger Build Desktop after creating the
unified v* tag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:36:56 +09:00

89 lines
2.5 KiB
YAML

name: Covector Version or Publish
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
actions: write
jobs:
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Covector version or publish
uses: jbolda/covector/packages/action@covector-v0
id: covector
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: version-or-publish
createRelease: true
- name: Create unified release tag and trigger build
if: steps.covector.outputs.commandRan == 'publish'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Extract version from root package.json
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
# Create tag if it doesn't already exist
if ! git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Creating unified tag: $TAG"
git tag "$TAG"
git push origin "$TAG"
else
echo "Tag $TAG already exists"
fi
# Trigger build workflow (GITHUB_TOKEN pushes don't trigger other workflows)
echo "Triggering Build Desktop workflow for $TAG"
gh workflow run "Build Desktop" --ref "$TAG"
- name: Sync Cargo.lock
if: steps.covector.outputs.commandRan == 'version'
run: |
cd apps/desktop/src-tauri
cargo generate-lockfile
- name: Create version bump PR
if: steps.covector.outputs.commandRan == 'version'
uses: peter-evans/create-pull-request@v7
with:
title: "chore: version bump"
commit-message: "chore: version bump"
labels: version
branch: covector/version-bump
body: |
## Version Bump
This PR was auto-generated based on `.changes/` files.
Merging will create a new version tag and trigger a release build.