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 : " " # comma-separated list, e.g. "eval,tscircuit,docs"
11+ UPSTREAM_PACKAGES_TO_UPDATE : " " # comma-separated list, e.g. "@tscircuit/core,@tscircuit/protos"
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+
36+ # - name: Create Pull Request
37+ # id: create-pr
38+ # uses: peter-evans/create-pull-request@v5
39+ # with:
40+ # commit-message: "chore: bump version"
41+ # title: "chore: bump version"
42+ # body: "Automated package update"
43+ # branch: bump-version-${{ github.run_number }}
44+ # base: main
45+ # token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
46+ # committer: tscircuitbot <[email protected] > 47+ # author: tscircuitbot <[email protected] > 48+
49+ # - name: Enable auto-merge
50+ # if: steps.create-pr.outputs.pull-request-number != ''
51+ # run: |
52+ # gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} --rebase --delete-branch
53+ # env:
54+ # GH_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
55+
56+ # - name: Trigger upstream repo updates
57+ # if: env.UPSTREAM_REPOS && env.UPSTREAM_PACKAGES_TO_UPDATE
58+ # run: |
59+ # IFS=',' read -ra REPOS <<< "${{ env.UPSTREAM_REPOS }}"
60+ # for repo in "${REPOS[@]}"; do
61+ # if [[ -n "$repo" ]]; then
62+ # echo "Triggering update for repo: $repo"
63+ # curl -X POST \
64+ # -H "Accept: application/vnd.github.v3+json" \
65+ # -H "Authorization: token ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}" \
66+ # -H "Content-Type: application/json" \
67+ # "https://api.github.com/repos/tscircuit/$repo/actions/workflows/update-package.yml/dispatches" \
68+ # -d "{\"ref\":\"main\",\"inputs\":{\"package_names\":\"${{ env.UPSTREAM_PACKAGES_TO_UPDATE }}\"}}"
69+ # fi
70+ # done
0 commit comments