Skip to content

Commit b9290e7

Browse files
authored
ci: publish pre-releases to the latest dist-tag (#21)
While pre-1.0, the newest release is what consumers should get by default, so every tag now publishes to `latest` instead of routing -beta/-alpha/-rc to a separate channel. Stops `latest` from going stale on an old version. Pre-release detection is kept (it drives the GitHub Release --prerelease flag). README install line reverted to a plain `npm install` to match.
1 parent 8cc095c commit b9290e7

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,27 @@ jobs:
1818
cache: 'npm'
1919
- run: npm ci
2020
- run: npm run build:lib
21-
- name: Determine npm dist-tag
22-
id: dist-tag
21+
- name: Detect pre-release
22+
id: meta
2323
run: |
2424
VERSION="${GITHUB_REF_NAME#v}"
25-
if [[ "$VERSION" == *-alpha* ]]; then
26-
echo "tag=alpha" >> "$GITHUB_OUTPUT"
27-
elif [[ "$VERSION" == *-beta* ]]; then
28-
echo "tag=beta" >> "$GITHUB_OUTPUT"
29-
elif [[ "$VERSION" == *-rc* ]]; then
30-
echo "tag=next" >> "$GITHUB_OUTPUT"
31-
else
32-
echo "tag=latest" >> "$GITHUB_OUTPUT"
33-
fi
3425
# Any SemVer pre-release identifier (the hyphen) marks a GitHub pre-release
3526
if [[ "$VERSION" == *-* ]]; then
3627
echo "prerelease=true" >> "$GITHUB_OUTPUT"
3728
else
3829
echo "prerelease=false" >> "$GITHUB_OUTPUT"
3930
fi
40-
- run: npm publish ./dist/grapesjs-angular --access public --provenance --tag ${{ steps.dist-tag.outputs.tag }}
31+
# Pre-1.0: the newest release is what consumers should get by default, so
32+
# every tag publishes to the `latest` dist-tag (npm's default). Revisit once
33+
# a stable release needs its own pre-release channel — e.g. route betas to
34+
# `next` and reserve `latest` for stable.
35+
- run: npm publish ./dist/grapesjs-angular --access public --provenance --tag latest
4136

4237
- name: Create GitHub Release
4338
env:
4439
GH_TOKEN: ${{ github.token }}
4540
TAG: ${{ github.ref_name }}
46-
PRERELEASE: ${{ steps.dist-tag.outputs.prerelease }}
41+
PRERELEASE: ${{ steps.meta.outputs.prerelease }}
4742
run: |
4843
VERSION="${TAG#v}"
4944
# Pull this version's section out of CHANGELOG.md (Keep a Changelog format):

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ An Angular wrapper for the [GrapesJS](https://grapesjs.com/) web builder framewo
2020

2121
## Installation
2222

23-
> **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.
23+
> **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`).
2424
2525
```bash
26-
npm install @ilq/grapesjs-angular@beta grapesjs
26+
npm install @ilq/grapesjs-angular grapesjs
2727
```
2828

2929
Add the GrapesJS CSS to your project:

0 commit comments

Comments
 (0)