forked from tscircuit/circuit-json-to-gerber
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (44 loc) · 1.53 KB
/
bun-pver-release.yml
File metadata and controls
45 lines (44 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Publish to npm
on:
push:
branches:
- main
workflow_dispatch:
env:
UPSTREAM_REPOS: "runframe"
UPSTREAM_PACKAGES_TO_UPDATE: "circuit-json-to-gerber"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install -g pver
- run: bun install --frozen-lockfile
- run: bun run build
- run: pver release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Trigger upstream repo updates
if: env.UPSTREAM_REPOS && env.UPSTREAM_PACKAGES_TO_UPDATE
run: |
IFS=',' read -ra REPOS <<< "${{ env.UPSTREAM_REPOS }}"
for repo in "${REPOS[@]}"; do
if [[ -n "$repo" ]]; then
echo "Triggering update for repo: $repo"
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
"https://api.github.com/repos/tscircuit/$repo/actions/workflows/update-package.yml/dispatches" \
-d "{\"ref\":\"main\",\"inputs\":{\"package_names\":\"${{ env.UPSTREAM_PACKAGES_TO_UPDATE }}\"}}"
fi
done