Fix wallet login type and email info regression (#839) #140
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Dists for Packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/install-dependencies | |
- name: Build package | |
run: pnpm run build | |
- name: Prepare dist branch | |
run: | | |
PACKAGES=("services/identity-instrument" "services/relayer" "wallet/core" "wallet/primitives" "wallet/wdk" "wallet/dapp-client") | |
for PACKAGE in "${PACKAGES[@]}"; do | |
BRANCH="dists/$PACKAGE" | |
PKG_DIR="packages/$PACKAGE" | |
echo "📦 Publishing $PACKAGE to $BRANCH" | |
mkdir -p /tmp/$PACKAGE | |
shopt -s dotglob | |
cp -r $PKG_DIR/* /tmp/$PACKAGE || true | |
cd /tmp/$PACKAGE | |
git init | |
git checkout -b $BRANCH | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
echo "🔧 Rewriting workspace: deps in package.json..." | |
node -e ' | |
const fs = require("fs"); | |
const path = require("path"); | |
const pkgPath = path.resolve("package.json"); | |
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); | |
const repo = "github:0xsequence/sequence.js"; | |
const versions = { | |
"@0xsequence/identity-instrument": `${repo}#dists/services/identity-instrument`, | |
"@0xsequence/relayer": `${repo}#dists/services/relayer`, | |
"@0xsequence/wallet-core": `${repo}#dists/wallet/core`, | |
"@0xsequence/wallet-primitives": `${repo}#dists/wallet/primitives`, | |
"@0xsequence/wallet-wdk": `${repo}#dists/wallet/wdk`, | |
}; | |
const rewrite = (deps = {}) => { | |
for (const k in deps) { | |
if (deps[k].startsWith("workspace:")) { | |
const version = versions[k]; | |
if (!version) { | |
console.warn(`No version found for ${k}, skipping...`); | |
continue; | |
} | |
deps[k] = version; | |
console.log(`→ ${k} → ${deps[k]}`); | |
} | |
} | |
}; | |
rewrite(pkg.dependencies); | |
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2)); | |
' | |
git add . | |
git commit -m "Build: publish $PACKAGE dist" | |
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
git push -f origin HEAD:$BRANCH | |
cd - | |
done |