chore(awn-cli): release v1.7.0 (#173) #101
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] | |
| workflow_dispatch: | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - run: npm ci | |
| - run: npm --prefix packages/agent-world-sdk install | |
| - run: npm --prefix gateway 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 }} | |
| # GITHUB_TOKEN pushes don't trigger workflows on the Version Packages | |
| # PR. Close and reopen it so CI checks run and branch protection is | |
| # satisfied without manual intervention. | |
| - name: Trigger CI on Version Packages PR | |
| if: steps.changesets.outputs.pullRequestNumber | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR=${{ steps.changesets.outputs.pullRequestNumber }} | |
| gh pr close "$PR" --comment "Closing to trigger CI checks" | |
| sleep 2 | |
| gh pr reopen "$PR" | |
| echo "Reopened Version Packages PR #$PR to trigger CI" | |
| # GITHUB_TOKEN-created releases don't trigger `release: [published]` | |
| # events, so we explicitly dispatch the CLI build workflow. | |
| - name: Trigger CLI release build | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run release-cli.yml --ref main | |
| echo "Dispatched release-cli.yml workflow" | |
| - name: Publish to ClawHub | |
| if: steps.changesets.outputs.published == 'true' | |
| continue-on-error: 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/awn" --version "$VERSION" |