chore(deps): update node.js to v22.23.1 (#30) #18
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: write-all | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "latest" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run unit tests | |
| run: npm test | |
| env: | |
| CI: true | |
| - name: Build | |
| run: npm run build | |
| # Stage a publish directory that mirrors the repo layout so that | |
| # package.json's `main: dist/index.js`, `files: ["dist", ...]`, and | |
| # openclaw `extensions: ["./dist/index.js"]` all resolve correctly | |
| # inside the published package. Publishing from dist/ itself shipped | |
| # a package with no JS (files: ["dist"] matched nothing) — see v1.0.3. | |
| - name: Stage package for publishing | |
| run: | | |
| mkdir -p pack | |
| cp package.json README.md LICENSE openclaw.plugin.json .releaserc.json pack/ | |
| cp -r skills pack/ | |
| cp -r dist pack/dist | |
| # prepublishOnly/prebuild assume full repo layout (src/, tests); | |
| # CI already built and tested above, so strip them. | |
| node -e "const p=require('./pack/package.json'); delete p.scripts.prepublishOnly; delete p.scripts.prebuild; require('fs').writeFileSync('./pack/package.json', JSON.stringify(p,null,2)+'\n')" | |
| - name: Release | |
| id: semantic | |
| uses: cycjimmy/semantic-release-action@v6 | |
| with: | |
| working_directory: pack | |
| extra_plugins: | | |
| conventional-changelog-conventionalcommits@9 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update pack/package.json version | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| run: | | |
| cd pack | |
| node -e "const p=require('./package.json'); p.version='${{ steps.semantic.outputs.new_release_version }}'; require('fs').writeFileSync('package.json', JSON.stringify(p, null, 2)+'\n')" | |
| - name: Install ClawHub CLI | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| run: npm i -g clawhub | |
| - name: Publish to ClawHub | |
| if: steps.semantic.outputs.new_release_published == 'true' | |
| run: | | |
| clawhub login --token "$CLAWHUB_TOKEN" --no-browser | |
| clawhub package publish pack/ \ | |
| --family code-plugin \ | |
| --version "${{ steps.semantic.outputs.new_release_version }}" \ | |
| --source-repo "${{ github.repository }}" \ | |
| --source-commit "${{ github.sha }}" \ | |
| --source-ref "${{ steps.semantic.outputs.new_release_git_tag }}" \ | |
| --changelog "${{ steps.semantic.outputs.new_release_notes }}" \ | |
| --tags latest | |
| env: | |
| CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} |