diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 91d232e..2623562 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,8 @@ name: Publish to NPM on: push: - branches: - - master + tags: + - "v*.*.*" workflow_dispatch: jobs: @@ -17,23 +17,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Validate tag exists on this push - run: | - TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "") - if [[ -z "$TAG" ]]; then - echo "❌ No tag found on HEAD. This push did not include a version tag." - echo "To publish, merge to master with a tag: git tag v1.0.0 && git push origin master --tags" - exit 1 - fi - if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "❌ Invalid tag format: $TAG. Expected: v*.*.*" - exit 1 - fi - echo "✅ Valid tag found: $TAG" - echo "TAG_VERSION=$TAG" >> $GITHUB_ENV - name: Setup Node.js uses: actions/setup-node@v4