π OpenHands: AI-Driven Development
fix: also tag prerelease versions as latest on npm (#394)
Rohit Malhotra9bcfbb6a0f44
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.ymlindex 5e8d29bbb7..6f5271e295 100644--- a/.github/workflows/npm-publish.yml+++ b/.github/workflows/npm-publish.yml@@ -76,19 +76,32 @@ jobs:id: npm-tagrun: |TAG_VERSION=${GITHUB_REF#refs/tags/v}+ # Temporary until the first stable release; see cleanup issue:+ # https://github.com/OpenHands/agent-canvas/issues/395if [[ "$TAG_VERSION" == *"alpha"* ]]; thenecho "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"* ]]; thenecho "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"* ]]; thenecho "tag=rc" >> $GITHUB_OUTPUT- echo "Publishing with tag: rc"+ echo "also_latest=true" >> $GITHUB_OUTPUT+ echo "Publishing with tag: rc (also updating latest)"elseecho "tag=latest" >> $GITHUB_OUTPUT+ echo "also_latest=false" >> $GITHUB_OUTPUTecho "Publishing with tag: latest"fi- name: Publish to npm with provenancerun: 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 latestdiff --git a/README.md b/README.mdindex 83b9c44c82..0e0ebcc052 100644--- a/README.md+++ b/README.md@@ -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.+```bashnpm install @openhands/agent-canvas```