ci: remove registry-url from setup-node (conflicts with OIDC auto-det… #24
Workflow file for this run
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 & Publish | |
| on: | |
| push: | |
| tags: | |
| - "cli-v*" | |
| - "sdk-v*" | |
| permissions: | |
| contents: write # Create GitHub Release | |
| id-token: write # npm trusted publishing (OIDC — no token needed) | |
| defaults: | |
| run: | |
| working-directory: . | |
| jobs: | |
| release-cli: | |
| if: startsWith(github.ref_name, 'cli-v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version | |
| id: meta | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#cli-v}" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "📦 CLI v$VERSION" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build SDK (dependency) | |
| run: npm run build --workspace=packages/sdk | |
| - name: Build CLI | |
| run: npm run build --workspace=packages/cli | |
| - name: Run tests | |
| run: npm test --workspace=packages/cli | |
| - name: Set package version | |
| working-directory: packages/cli | |
| run: npm version "${{ steps.meta.outputs.version }}" --no-git-tag-version | |
| - name: Upgrade npm for trusted publishing | |
| run: npm i -g npm@latest && npm --version | |
| - name: Publish to npm (trusted publishing) | |
| working-directory: packages/cli | |
| run: npm publish --access public --provenance | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --title "CLI v${{ steps.meta.outputs.version }}" \ | |
| --generate-notes \ | |
| --notes "## 📦 @pixelml/agenticflow-cli@${{ steps.meta.outputs.version }} | |
| \`\`\`bash | |
| npm install -g @pixelml/agenticflow-cli@${{ steps.meta.outputs.version }} | |
| \`\`\` | |
| [View on npm](https://www.npmjs.com/package/@pixelml/agenticflow-cli/v/${{ steps.meta.outputs.version }}) | |
| ---" | |
| - name: Summary | |
| run: | | |
| echo "## ✅ CLI v${{ steps.meta.outputs.version }} released" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Published to [npm](https://www.npmjs.com/package/@pixelml/agenticflow-cli/v/${{ steps.meta.outputs.version }})" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- GitHub Release created with auto-generated notes" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- 🔒 Trusted publishing (OIDC, no token)" >> "$GITHUB_STEP_SUMMARY" | |
| release-sdk: | |
| if: startsWith(github.ref_name, 'sdk-v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version | |
| id: meta | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#sdk-v}" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "📦 SDK v$VERSION" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build SDK | |
| run: npm run build --workspace=packages/sdk | |
| - name: Run tests | |
| run: npm test --workspace=packages/sdk | |
| - name: Set package version | |
| working-directory: packages/sdk | |
| run: npm version "${{ steps.meta.outputs.version }}" --no-git-tag-version | |
| - name: Upgrade npm for trusted publishing | |
| run: npm i -g npm@latest && npm --version | |
| - name: Publish to npm (trusted publishing) | |
| working-directory: packages/sdk | |
| run: npm publish --access public --provenance | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --title "SDK v${{ steps.meta.outputs.version }}" \ | |
| --generate-notes \ | |
| --notes "## 📦 @pixelml/agenticflow-sdk@${{ steps.meta.outputs.version }} | |
| \`\`\`bash | |
| npm install @pixelml/agenticflow-sdk@${{ steps.meta.outputs.version }} | |
| \`\`\` | |
| [View on npm](https://www.npmjs.com/package/@pixelml/agenticflow-sdk/v/${{ steps.meta.outputs.version }}) | |
| ---" | |
| - name: Summary | |
| run: | | |
| echo "## ✅ SDK v${{ steps.meta.outputs.version }} released" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- Published to [npm](https://www.npmjs.com/package/@pixelml/agenticflow-sdk/v/${{ steps.meta.outputs.version }})" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- GitHub Release created with auto-generated notes" >> "$GITHUB_STEP_SUMMARY" | |
| echo "- 🔒 Trusted publishing (OIDC, no token)" >> "$GITHUB_STEP_SUMMARY" |