Merge pull request #1197 from guillaumegay13/codex/fix/1179-cost-shor… #360
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 | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm ci | |
| - run: npm run build | |
| - uses: changesets/action@v1 | |
| id: changesets | |
| with: | |
| createGithubReleases: false | |
| publish: npm run release | |
| version: npm run version-packages | |
| title: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Create GitHub Release | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }} | |
| run: | | |
| VERSION=$(echo "$PUBLISHED_PACKAGES" | jq -r '.[0].version') | |
| TAG="$(echo "$PUBLISHED_PACKAGES" | jq -r '.[0].name')@${VERSION}" | |
| git tag "$TAG" || true | |
| git push origin "$TAG" | |
| BODY=$(awk -v ver="## ${VERSION}" \ | |
| '$0 == ver { found=1; next } found && /^## / { exit } found { print }' \ | |
| packages/openclaw-plugin/CHANGELOG.md) | |
| BODY=$(echo "$BODY" | sed \ | |
| -e 's/^### Major Changes$/### 💥 Major Changes/' \ | |
| -e 's/^### Minor Changes$/### ✨ Minor Changes/' \ | |
| -e 's/^### Patch Changes$/### 🐛 Patch Changes/') | |
| gh release create "$TAG" --title "v${VERSION}" --notes "$BODY" --verify-tag |