MeTTa TS 1.2.0-experimental.0 #22
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: Publish | |
| # Publishes all @metta-ts/* packages to npm with provenance (a signed link back | |
| # to this repo and commit). Runs when a v* tag is pushed, or on demand. | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # required for npm provenance attestations | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: "https://registry.npmjs.org" | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm -r build | |
| # Route the npm dist-tag by the semver prerelease identifier: stable versions stay on | |
| # `latest`, `-experimental.*` versions publish to the opt-in `experimental` channel, and | |
| # any other prerelease lands on `next`. Without an explicit tag npm would point `latest` | |
| # at a prerelease. | |
| - name: Resolve npm dist-tag | |
| id: channel | |
| run: | | |
| VERSION=$(node -p "require('./packages/core/package.json').version") | |
| case "$VERSION" in | |
| *-experimental*) TAG=experimental ;; | |
| *-*) TAG=next ;; | |
| *) TAG=latest ;; | |
| esac | |
| echo "Publishing $VERSION to dist-tag $TAG" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - run: > | |
| pnpm -r --filter "./packages/*" publish --access public --provenance | |
| --no-git-checks --tag ${{ steps.channel.outputs.tag }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |