1+ # Created using @tscircuit/plop (npm install -g @tscircuit/plop)
2+ name : Publish to npm
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ env :
10+ # UPSTREAM_REPOS: "<UPSTREAM_REPO_1>,<UPSTREAM_REPO_2>,<UPSTREAM_REPO_3>" # comma-separated list, e.g. "eval,tscircuit,docs"
11+ # PACKAGE_NAMES: "<PACKAGE_NAME_1>,<PACKAGE_NAME_2>" # comma-separated list, e.g. "@tscircuit/core,@tscircuit/props"
12+
13+ jobs :
14+ publish :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ token : ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
20+ - name : Setup bun
21+ uses : oven-sh/setup-bun@v2
22+ with :
23+ bun-version : latest
24+ - uses : actions/setup-node@v3
25+ with :
26+ node-version : 20
27+ registry-url : https://registry.npmjs.org/
28+ - run : npm install -g pver
29+ - run : bun install --frozen-lockfile
30+ - run : bun run build
31+ - run : pver release
32+ env :
33+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
34+ GITHUB_TOKEN : ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
35+ # - name: Trigger upstream repo updates
36+ # if: env.UPSTREAM_REPOS && env.PACKAGE_NAMES
37+ # run: |
38+ # IFS=',' read -ra REPOS <<< "${{ env.UPSTREAM_REPOS }}"
39+ # for repo in "${REPOS[@]}"; do
40+ # if [[ -n "$repo" ]]; then
41+ # echo "Triggering update for repo: $repo"
42+ # curl -X POST \
43+ # -H "Accept: application/vnd.github.v3+json" \
44+ # -H "Authorization: token ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}" \
45+ # -H "Content-Type: application/json" \
46+ # "https://api.github.com/repos/tscircuit/$repo/actions/workflows/update-package.yml/dispatches" \
47+ # -d "{\"ref\":\"main\",\"inputs\":{\"package_names\":\"${{ env.PACKAGE_NAMES }}\"}}"
48+ # fi
49+ # done
0 commit comments