Skip to content

Commit 2117029

Browse files
committed
add release workflows
1 parent c748f7d commit 2117029

File tree

4 files changed

+153
-0
lines changed

4 files changed

+153
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
2+
name: Format Check
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
format-check:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup bun
18+
uses: oven-sh/setup-bun@v2
19+
with:
20+
bun-version: latest
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Run format check
26+
run: bun run format:check
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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

.github/workflows/bun-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
2+
name: Bun Test
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
# Skip test for PRs that not chore: bump version
16+
if: "${{ github.event_name != 'pull_request' || github.event.pull_request.title != 'chore: bump version' }}"
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup bun
23+
uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: latest
26+
27+
- name: Install dependencies
28+
run: bun install
29+
30+
- name: Run tests
31+
run: bun test
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
2+
name: Type Check
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
type-check:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup bun
18+
uses: oven-sh/setup-bun@v2
19+
with:
20+
bun-version: latest
21+
22+
- name: Install dependencies
23+
run: bun i
24+
25+
- name: Run type check
26+
run: bunx tsc --noEmit

0 commit comments

Comments
 (0)