Skip to content

Commit 80099df

Browse files
committed
fix: slack broadcasting - canary
1 parent 2c46763 commit 80099df

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

.github/workflows/dev.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
uses: useblacksmith/setup-node@v5
5757
with:
5858
node-version-file: '.nvmrc'
59+
registry-url: 'https://registry.npmjs.org'
5960

6061
- name: Setup pnpm
6162
uses: pnpm/action-setup@v4
@@ -122,9 +123,46 @@ jobs:
122123
run: |
123124
pnpm exec lerna version ${{ steps.determine-publish-type.outputs.version_args }}
124125
126+
# We use pnpm to pack (resolves catalog: protocol) then npm to publish (OIDC works).
127+
# lerna publish doesn't resolve pnpm's catalog: protocol, and pnpm publish doesn't
128+
# properly handle npm's OIDC token exchange.
125129
- name: Publish to npm (OIDC)
126130
run: |
127-
pnpm exec lerna publish from-git --yes --dist-tag "${{ steps.determine-publish-type.outputs.dist_tag }}"
131+
DIST_TAG="${{ steps.determine-publish-type.outputs.dist_tag }}"
132+
PUBLISHED_PACKAGES="[]"
133+
134+
# Find all packages, pack with pnpm (resolves catalog:), publish with npm (OIDC)
135+
for pkg_json in packages/*/package.json packages/wallets/*/package.json; do
136+
pkg_dir=$(dirname "$pkg_json")
137+
pkg_name=$(node -p "require('./$pkg_json').name")
138+
pkg_version=$(node -p "require('./$pkg_json').version")
139+
140+
echo "📦 Publishing $pkg_name@$pkg_version"
141+
142+
# Pack with pnpm to resolve catalog: dependencies
143+
cd "$pkg_dir"
144+
pnpm pack
145+
146+
# Find the tarball
147+
tarball=$(ls *.tgz 2>/dev/null | head -1)
148+
149+
if [ -n "$tarball" ]; then
150+
# Publish with npm for OIDC support
151+
if npm publish "$tarball" --access public --tag "$DIST_TAG" --provenance; then
152+
PUBLISHED_PACKAGES=$(echo "$PUBLISHED_PACKAGES" | node -p "JSON.stringify([...JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')), {name:'$pkg_name',version:'$pkg_version'}])")
153+
fi
154+
rm -f "$tarball"
155+
else
156+
echo "⚠️ No tarball found for $pkg_name"
157+
fi
158+
159+
cd - > /dev/null
160+
done
161+
162+
# Generate publish summary for Slack notification
163+
echo "{\"publishedPackages\":$PUBLISHED_PACKAGES}" > pnpm-publish-summary.json
164+
echo "📋 Published packages summary:"
165+
cat pnpm-publish-summary.json
128166
129167
- name: Push tags to git
130168
run: |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"publish:olp-proto-ts": "./protoV2/olp/publish.sh",
2222
"generate:abacus-proto-ts": "./protoV2/abacus/gen.sh",
2323
"publish:abacus-proto-ts": "./protoV2/abacus/publish.sh",
24-
"release:patch": "pnpm build:fresh && lerna version patch --conventional-commits --force-git-tag --yes && lerna publish from-git --yes",
25-
"release:minor": "pnpm build:fresh && lerna version minor --conventional-commits --force-git-tag --yes && lerna publish from-git --yes",
24+
"release:patch": "pnpm build:fresh && lerna version patch --conventional-commits --force-git-tag --yes && pnpm publish -r --access public --tag latest --no-git-checks",
25+
"release:minor": "pnpm build:fresh && lerna version minor --conventional-commits --force-git-tag --yes && pnpm publish -r --access public --tag latest --no-git-checks",
2626
"build:watch": "node etc/bootstrapEnv && lerna run build:watch --parallel --stream",
2727
"build:fresh": "pnpm clean-up && pnpm build:check",
2828
"patch": "lerna version patch",

0 commit comments

Comments
 (0)