Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions .github/workflows/hash-deploy-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,29 @@ jobs:
- name: Build Production
run: ./scripts/build-production.sh

- name: Upload to Storacha
id: upload
uses: storacha/add-to-web3@892505d8e70c79336721485e5500155c17a728e0 # v4
with:
path_to_add: './dist'
secret_key: ${{ secrets.STORACHA_PRINCIPAL }}
proof: ${{ secrets.STORACHA_PROOF }}
- name: Install Kubo (IPFS CLI)
run: |
wget -q https://dist.ipfs.tech/kubo/v0.34.1/kubo_v0.34.1_linux-amd64.tar.gz
tar -xzf kubo_v0.34.1_linux-amd64.tar.gz
sudo cp kubo/ipfs /usr/local/bin/
ipfs init --profile=badgerds
ipfs version

- name: Generate IPFS Hash
id: ipfs
run: |
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)

echo "hash_v0=$HASH" >> $GITHUB_OUTPUT
echo "hash_v1=$HASH_V1" >> $GITHUB_OUTPUT

echo "IPFS Hash (v0): $HASH"
echo "IPFS Hash (v1): $HASH_V1"

- name: Update IPFS Hash in Repo
run: |
HASH="${{ steps.upload.outputs.cid }}"
HASH="${{ steps.ipfs.outputs.hash_v0 }}"

# Create shields.io endpoint format JSON
mkdir -p /tmp/ipfs-meta
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
Expand All @@ -28,7 +28,7 @@ jobs:
run: bash ./scripts/build-development.sh

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
Expand Down
39 changes: 23 additions & 16 deletions scripts/build-production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,26 @@ NODE_ENV=production OPENSCAN_COMMIT_HASH=$COMMIT_HASH npm run build
echo "Production build completed!"
echo "Build output is in ./dist/"

# Get IPFS hash (ensure consistent chunking)
ipfs add -r --chunker=size-262144 --raw-leaves=false ./dist
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)

echo "IPFS Hash (v0): $HASH"
echo "IPFS Hash (v1): $HASH_V1"
echo ""
echo "IPFS URLs:"
echo " - https://ipfs.io/ipfs/$HASH"
echo " - https://cloudflare-ipfs.com/ipfs/$HASH"
echo " - https://gateway.ipfs.io/ipfs/$HASH"
echo ""
echo "IPFS v1 URLs:"
echo " - https://$HASH_V1.ipfs.dweb.link"
echo " - https://$HASH_V1.ipfs.cf-ipfs.com"
# Generate IPFS hash if ipfs CLI (Kubo) is available
if command -v ipfs &> /dev/null; then
echo ""
echo "Generating IPFS hash..."
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)

echo "IPFS Hash (v0): $HASH"
echo "IPFS Hash (v1): $HASH_V1"
echo ""
echo "IPFS URLs:"
echo " - https://ipfs.io/ipfs/$HASH"
echo " - https://cloudflare-ipfs.com/ipfs/$HASH"
echo " - https://gateway.ipfs.io/ipfs/$HASH"
echo ""
echo "IPFS v1 URLs:"
echo " - https://$HASH_V1.ipfs.dweb.link"
echo " - https://$HASH_V1.ipfs.cf-ipfs.com"
else
echo ""
echo "IPFS CLI (Kubo) not found. Skipping hash generation."
echo "Install Kubo to generate IPFS hashes: https://docs.ipfs.tech/install/"
fi
Loading