Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ name: release
# It typechecks, tests, builds, and publishes `meshy-cli` plus its scoped alias
# `@meshy-ai/cli` at whatever version package.json currently declares.
#
# One-time setup: an npm automation token with publish rights on `meshy-cli`
# and the `@meshy-ai` scope, stored as the `NPM_TOKEN` secret.
# No npm token is stored anywhere: both packages publish through npm trusted
# publishing (GitHub OIDC), with provenance. On npmjs.com each package trusts
# meshy-dev/meshy-cli, this workflow file (release.yml) and the `release`
# environment, which only `main` may deploy to. Renaming the file or the
# environment breaks publishing until both npm settings are recreated.

on:
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v7

Expand All @@ -38,9 +43,12 @@ jobs:
run: |
test "$(node dist/index.js --version)" = "$(node -p "require('./package.json').version")"

# Trusted publishing needs npm 11.5.1 or newer.
- run: npm install -g npm@^11.5.1

# Both publish steps skip versions that already exist on the registry,
# so re-running the workflow after a half-published release (e.g. the
# unscoped package went out but the alias failed on scope/token setup)
# unscoped package went out but the alias failed on its npm setup)
# resumes at the missing package instead of erroring on the first.
- name: Publish meshy-cli
run: |
Expand All @@ -50,8 +58,6 @@ jobs:
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish scoped alias @meshy-ai/cli (same version)
run: |
Expand All @@ -62,5 +68,3 @@ jobs:
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading