mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 13:58:33 +08:00
fix: also tag prerelease versions as latest on npm (#394)
* fix: also tag prerelease versions as latest on npm Since we don't have stable releases yet, prerelease versions (alpha, beta, rc) should also be tagged as 'latest' so users running 'npm install @openhands/agent-canvas' get the most recent version rather than needing to specify @alpha explicitly. The workflow now: 1. Publishes with the prerelease tag (e.g., 'alpha') 2. Also adds the 'latest' tag to that version Co-authored-by: openhands <openhands@all-hands.dev> * docs: note npm dist-tag cleanup issue Co-authored-by: openhands <openhands@all-hands.dev> * docs: warn about prerelease npm latest tag Co-authored-by: openhands <openhands@all-hands.dev> --------- Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
committed by
GitHub
co-authored by
openhands
parent
8fc9a8b50c
commit
9bcfbb6a0f
@@ -76,19 +76,32 @@ jobs:
|
||||
id: npm-tag
|
||||
run: |
|
||||
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
||||
# Temporary until the first stable release; see cleanup issue:
|
||||
# https://github.com/OpenHands/agent-canvas/issues/395
|
||||
if [[ "$TAG_VERSION" == *"alpha"* ]]; then
|
||||
echo "tag=alpha" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: alpha"
|
||||
echo "also_latest=true" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: alpha (also updating latest)"
|
||||
elif [[ "$TAG_VERSION" == *"beta"* ]]; then
|
||||
echo "tag=beta" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: beta"
|
||||
echo "also_latest=true" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: beta (also updating latest)"
|
||||
elif [[ "$TAG_VERSION" == *"rc"* ]]; then
|
||||
echo "tag=rc" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: rc"
|
||||
echo "also_latest=true" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: rc (also updating latest)"
|
||||
else
|
||||
echo "tag=latest" >> $GITHUB_OUTPUT
|
||||
echo "also_latest=false" >> $GITHUB_OUTPUT
|
||||
echo "Publishing with tag: latest"
|
||||
fi
|
||||
|
||||
- name: Publish to npm with provenance
|
||||
run: npm publish --access public --provenance --tag ${{ steps.npm-tag.outputs.tag }}
|
||||
|
||||
- name: Also tag as latest for prerelease versions
|
||||
if: steps.npm-tag.outputs.also_latest == 'true'
|
||||
run: |
|
||||
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
||||
echo "Adding 'latest' tag to @openhands/agent-canvas@$PACKAGE_VERSION"
|
||||
npm dist-tag add @openhands/agent-canvas@$PACKAGE_VERSION latest
|
||||
|
||||
@@ -91,6 +91,10 @@ The Agent Server is often paired with an [Automation Server](https://github.com/
|
||||
|
||||
Agent Canvas is also available as an npm package for embedding in your own applications:
|
||||
|
||||
> [!WARNING]
|
||||
> Agent Canvas has not published a stable release yet. Until the first stable version is available, the npm `latest` dist-tag may point to alpha, beta, or release-candidate builds, so `npm install @openhands/agent-canvas` can install a prerelease. Pin an exact version if you need predictable behavior.
|
||||
> This temporary behavior is tracked in [#395](https://github.com/OpenHands/agent-canvas/issues/395); retag `latest` to the first stable release when it ships.
|
||||
|
||||
```bash
|
||||
npm install @openhands/agent-canvas
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user