fix: use cd for SDK npm publish instead of --prefix (#86) #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - run: npm ci | |
| - run: npm --prefix packages/agent-world-sdk install | |
| - run: npm run build | |
| - run: npm --prefix packages/agent-world-sdk run build | |
| - run: node --test test/*.test.mjs | |
| # Creates a "Version Packages" PR when changesets are pending, | |
| # or publishes to npm + creates GH Release when Version PR is merged. | |
| - name: Create Version PR or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: npm run version | |
| publish: npm run release | |
| title: "chore: version packages" | |
| commit: "chore: version packages" | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish to ClawHub | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| npx clawhub@latest auth login --token "$CLAWHUB_TOKEN" --no-browser | |
| # Patch clawhub publish.js to include acceptLicenseTerms (required by API, missing in CLI v0.7.0) | |
| PUBLISH_JS=$(find ~/.npm/_npx -path "*/clawhub/dist/cli/commands/publish.js" 2>/dev/null | head -1) | |
| if [ -n "$PUBLISH_JS" ]; then | |
| sed -i '/tags,/a\ acceptLicenseTerms: true,' "$PUBLISH_JS" | |
| fi | |
| npx clawhub@latest publish "$(pwd)/skills/dap" --version "$VERSION" |