Skip to content

Commit bb73538

Browse files
committed
ci: fixed broken publish script
1 parent 23f0e25 commit bb73538

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,8 @@ jobs:
7171
uses: changesets/action@v1
7272
with:
7373
version: bun run version
74-
publish: |
75-
TAG=$(bun -e 'const main=async()=>{try{const f=Bun.file(".changeset/pre.json");if(!await f.exists())return;const p=await f.json();if(p.mode==="pre"&&typeof p.tag==="string")console.log(p.tag)}catch{}};await main()')
76-
for dir in packages/*; do
77-
if [ -n "$TAG" ]; then
78-
(cd "$dir" && bun publish --tolerate-republish --tag "$TAG")
79-
else
80-
(cd "$dir" && bun publish --tolerate-republish)
81-
fi
82-
done
83-
bunx changeset tag
74+
# changesets/action splits publish on whitespace (first token = executable); use a script.
75+
publish: bun run ci:publish
8476
commit: "chore: version packages"
8577
title: "chore: version packages"
8678
createGithubReleases: true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"check": "turbo run check",
1616
"package": "turbo run package",
1717
"format": "prettier --write .",
18-
"version": "changeset version"
18+
"ci:version": "changeset version",
19+
"ci:publish": "bash ./scripts/ci-publish.sh"
1920
},
2021
"devDependencies": {
2122
"@changesets/cli": "^2.30.0",

scripts/ci-publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TAG=$(bun -e 'const main=async()=>{try{const f=Bun.file(".changeset/pre.json");if(!await f.exists())return;const p=await f.json();if(p.mode==="pre"&&typeof p.tag==="string")console.log(p.tag)}catch{}};await main()')
5+
for dir in packages/*; do
6+
if [ -n "$TAG" ]; then
7+
(cd "$dir" && bun publish --tolerate-republish --tag "$TAG")
8+
else
9+
(cd "$dir" && bun publish --tolerate-republish)
10+
fi
11+
done
12+
bunx changeset tag

0 commit comments

Comments
 (0)