From 9ac11e193ba460b193614b71ce3eef741f9bdcb1 Mon Sep 17 00:00:00 2001 From: Julian Fraser Date: Wed, 22 Apr 2026 21:12:46 -0400 Subject: [PATCH] Fix publish workflow for prerelease versions npm requires --tag for prerelease versions. Auto-detect alpha/beta/rc from the git tag and set the npm dist-tag accordingly (alpha, beta, next, or latest). --- .github/workflows/publish.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1e87db3..62f38f0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,4 +18,17 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build:lib - - run: npm publish ./dist/grapesjs-angular --access public --provenance + - name: Determine npm dist-tag + id: dist-tag + run: | + VERSION="${GITHUB_REF_NAME#v}" + if [[ "$VERSION" == *-alpha* ]]; then + echo "tag=alpha" >> "$GITHUB_OUTPUT" + elif [[ "$VERSION" == *-beta* ]]; then + echo "tag=beta" >> "$GITHUB_OUTPUT" + elif [[ "$VERSION" == *-rc* ]]; then + echo "tag=next" >> "$GITHUB_OUTPUT" + else + echo "tag=latest" >> "$GITHUB_OUTPUT" + fi + - run: npm publish ./dist/grapesjs-angular --access public --provenance --tag ${{ steps.dist-tag.outputs.tag }}