Release #68
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: | |
| inputs: | |
| publish_only: | |
| description: 'Skip release-please and publish current packages/cli version to npm' | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| if: github.event_name == 'push' || inputs.publish_only != true | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cli_release_created: ${{ steps.release.outputs['packages/cli--release_created'] }} | |
| cli_tag_name: ${{ steps.release.outputs['packages/cli--tag_name'] }} | |
| schema_release_created: ${{ steps.release.outputs['packages/schema--release_created'] }} | |
| schema_tag_name: ${{ steps.release.outputs['packages/schema--tag_name'] }} | |
| steps: | |
| - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0 | |
| id: release | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| npm-publish: | |
| name: Publish to npm | |
| needs: release-please | |
| if: | | |
| always() && | |
| ( | |
| (github.event_name == 'workflow_dispatch' && inputs.publish_only == true) || | |
| (needs.release-please.result == 'success' && | |
| (needs.release-please.outputs.cli_release_created == 'true' || | |
| needs.release-please.outputs.schema_release_created == 'true')) | |
| ) | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.3.11 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version-file: .nvmrc | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build all | |
| run: bun run build | |
| # Workaround: bun pm pack resolves workspace:* from bun.lock, not | |
| # package.json (oven-sh/bun#20477). release-please bumps versions in | |
| # package.json but bun install won't propagate them to the lockfile | |
| # (oven-sh/bun#18906). Regenerate the lockfile so pack embeds the | |
| # correct workspace dependency versions. | |
| - name: Sync lockfile with workspace versions | |
| run: rm bun.lock && bun install | |
| - name: Publish @pleaseai/ask-schema | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| needs.release-please.outputs.schema_release_created == 'true' | |
| working-directory: packages/schema | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if npm view "@pleaseai/ask-schema@$VERSION" version 2>/dev/null; then | |
| echo "⚠ @pleaseai/ask-schema@$VERSION already published, skipping" | |
| else | |
| bun pm pack | |
| npm publish pleaseai-ask-schema-*.tgz --provenance --access public | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish @pleaseai/ask | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| needs.release-please.outputs.cli_release_created == 'true' | |
| working-directory: packages/cli | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if npm view "@pleaseai/ask@$VERSION" version 2>/dev/null; then | |
| echo "⚠ @pleaseai/ask@$VERSION already published, skipping" | |
| else | |
| bun pm pack | |
| npm publish pleaseai-ask-*.tgz --provenance --access public | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |