Files
filip131311 0dca6bbfef fix: build workspace deps before packing/publishing argent (#172)
## Summary
- The `publish` and `publish-next` workflows ran `npm run build -w
@swmansion/argent` directly, but after the recent CLI/MCP/main split,
`@swmansion/argent` imports types from `@argent/cli`, `@argent/mcp`,
`@argent/installer`, `@argent/tools-client`. Those packages expose types
from their own `dist/index.d.ts`, which doesn't exist until they're
built — so argent's `tsc` failed with `TS2307: Cannot find module
'@argent/...'` (e.g. [run
25161244218](https://github.com/software-mansion/argent/actions/runs/25161244218)).
- Added `npx tsc --build` before the per-workspace argent build in both
publish workflows so the sibling packages produce their `dist/` first.
This mirrors what `unit-tests.yml` already does, which is why the
regression didn't surface on PRs.
- Applied the same fix to the root `pack` script (`npm run pack`) since
it had the same latent bug for local packing.

## Test plan
- [x] Reproduced the failure locally by wiping every `dist/` and
`tsconfig.tsbuildinfo`, then running `npm run build -w
@swmansion/argent` — same four `TS2307` errors as CI.
- [x] Verified `npx tsc --build && npm run build -w @swmansion/argent`
succeeds from a clean state.
- [ ] Re-run the `Publish prerelease to npm (next)` workflow against
this branch (or after merge) to confirm green.
2026-04-30 12:57:28 +02:00

60 lines
1.6 KiB
YAML

name: Publish to npm
on:
workflow_dispatch:
inputs:
ref:
description: "Branch, tag, or SHA to publish (e.g. v0.5.3)"
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
scope: "@swmansion"
- name: Resolve native binaries tag
id: binaries_tag
run: |
REF="${{ inputs.ref }}"
echo "tag=argent-${REF//\//-}" >> $GITHUB_OUTPUT
- name: Download signed simulator-server binary
run: bash scripts/download-simulator-server.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download signed native binaries (dylibs + ax-service)
run: bash scripts/download-native-binaries.sh "${{ steps.binaries_tag.outputs.tag }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm ci
- run: npx tsc --build
- run: npm run build -w @swmansion/argent
- run: test -x packages/argent/bin/simulator-server
- run: test -x packages/argent/bin/ax-service
- run: test -f packages/argent/dylibs/libNativeDevtoolsIos.dylib
- run: test -f packages/argent/dylibs/libKeyboardPatch.dylib
- run: test -f packages/argent/dylibs/libArgentInjectionBootstrap.dylib
- run: npm pack --dry-run -w @swmansion/argent
- run: npm publish -w @swmansion/argent
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}