Scaffold safe-chain-bun setup command

This commit is contained in:
Sander Declerck 2025-09-05 15:34:57 +02:00
parent 8f6742504f
commit 59762d2472
No known key found for this signature in database
4 changed files with 80 additions and 11 deletions

View file

@ -27,8 +27,10 @@ jobs:
version="${{ github.ref_name }}"
echo "tag=$version" >> $GITHUB_OUTPUT
- name: Set the version in safe-chain package
run: npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }} --workspace=packages/safe-chain
- name: Set the version in both packages
run: |
npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }} --workspace=packages/safe-chain
npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }} --workspace=packages/safe-chain-bun
- name: Install dependencies
run: npm ci
@ -42,9 +44,24 @@ jobs:
cp LICENSE packages/safe-chain/
cp -r docs packages/safe-chain/
- name: Publish to npm
- name: Publish safe-chain to npm
run: |
echo "Publishing version ${{ steps.get_version.outputs.tag }} to NPM"
echo "Publishing safe-chain version ${{ steps.get_version.outputs.tag }} to NPM"
npm publish --workspace=packages/safe-chain --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Update safe-chain-bun dependency for publishing
run: |
# During development, safe-chain-bun uses "file:../safe-chain" to depend on the local package
# This works great for local development but breaks when published to npm registry
# We need to replace it with the actual version number so users can install from npm
# Changes: "@aikidosec/safe-chain": "file:../safe-chain" → "@aikidosec/safe-chain": "1.0.0"
sed -i 's/"@aikidosec\/safe-chain": "file:..\/safe-chain"/"@aikidosec\/safe-chain": "${{ steps.get_version.outputs.tag }}"/g' packages/safe-chain-bun/package.json
- name: Publish safe-chain-bun to npm
run: |
echo "Publishing safe-chain-bun version ${{ steps.get_version.outputs.tag }} to NPM"
npm publish --workspace=packages/safe-chain-bun --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

View file

@ -26,14 +26,16 @@ jobs:
- name: Run ESLint
run: npm run lint
- name: Create package tarball
run: npm pack --workspace=packages/safe-chain
- name: Create package tarballs
run: |
npm pack --workspace=packages/safe-chain
npm pack --workspace=packages/safe-chain-bun
- name: Upload package tarball
- name: Upload package tarballs
uses: actions/upload-artifact@v4
with:
name: safe-chain-package
path: aikidosec-safe-chain-*.tgz
name: safe-chain-packages
path: aikidosec-*.tgz
e2e-tests:
name: Run E2E tests