diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 254b2a3..5a3b1e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,32 +18,27 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build:lib - - name: Determine npm dist-tag - id: dist-tag + - name: Detect pre-release + id: meta 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 # Any SemVer pre-release identifier (the hyphen) marks a GitHub pre-release if [[ "$VERSION" == *-* ]]; then echo "prerelease=true" >> "$GITHUB_OUTPUT" else echo "prerelease=false" >> "$GITHUB_OUTPUT" fi - - run: npm publish ./dist/grapesjs-angular --access public --provenance --tag ${{ steps.dist-tag.outputs.tag }} + # Pre-1.0: the newest release is what consumers should get by default, so + # every tag publishes to the `latest` dist-tag (npm's default). Revisit once + # a stable release needs its own pre-release channel — e.g. route betas to + # `next` and reserve `latest` for stable. + - run: npm publish ./dist/grapesjs-angular --access public --provenance --tag latest - name: Create GitHub Release env: GH_TOKEN: ${{ github.token }} TAG: ${{ github.ref_name }} - PRERELEASE: ${{ steps.dist-tag.outputs.prerelease }} + PRERELEASE: ${{ steps.meta.outputs.prerelease }} run: | VERSION="${TAG#v}" # Pull this version's section out of CHANGELOG.md (Keep a Changelog format): diff --git a/README.md b/README.md index a40e89f..a198194 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ An Angular wrapper for the [GrapesJS](https://grapesjs.com/) web builder framewo ## Installation -> **Pre-release:** the newest build ships under the npm `beta` dist-tag. Install with `@beta` to get it — a plain `npm install` currently resolves to an older beta. +> **Pre-release:** the library is in beta — `npm install` gives you the newest beta (the `latest` tag tracks the most recent release until a stable `1.0`). ```bash -npm install @ilq/grapesjs-angular@beta grapesjs +npm install @ilq/grapesjs-angular grapesjs ``` Add the GrapesJS CSS to your project: