Skip to content

Commit 3fdf63c

Browse files
authored
Merge pull request #368 from AugustoL/chore/merge-main-into-dev
chore: cherry-pick main commits to resolve dev conflicts (unblocks #360)
2 parents 24a72c3 + 11d2b77 commit 3fdf63c

3 files changed

Lines changed: 45 additions & 26 deletions

File tree

‎.github/workflows/hash-deploy-build.yml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,29 @@ jobs:
2626
- name: Build Production
2727
run: ./scripts/build-production.sh
2828

29-
- name: Upload to Storacha
30-
id: upload
31-
uses: storacha/add-to-web3@892505d8e70c79336721485e5500155c17a728e0 # v4
32-
with:
33-
path_to_add: './dist'
34-
secret_key: ${{ secrets.STORACHA_PRINCIPAL }}
35-
proof: ${{ secrets.STORACHA_PROOF }}
29+
- name: Install Kubo (IPFS CLI)
30+
run: |
31+
wget -q https://dist.ipfs.tech/kubo/v0.34.1/kubo_v0.34.1_linux-amd64.tar.gz
32+
tar -xzf kubo_v0.34.1_linux-amd64.tar.gz
33+
sudo cp kubo/ipfs /usr/local/bin/
34+
ipfs init --profile=badgerds
35+
ipfs version
36+
37+
- name: Generate IPFS Hash
38+
id: ipfs
39+
run: |
40+
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
41+
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)
42+
43+
echo "hash_v0=$HASH" >> $GITHUB_OUTPUT
44+
echo "hash_v1=$HASH_V1" >> $GITHUB_OUTPUT
45+
46+
echo "IPFS Hash (v0): $HASH"
47+
echo "IPFS Hash (v1): $HASH_V1"
3648
3749
- name: Update IPFS Hash in Repo
3850
run: |
39-
HASH="${{ steps.upload.outputs.cid }}"
51+
HASH="${{ steps.ipfs.outputs.hash_v0 }}"
4052
4153
# Create shields.io endpoint format JSON
4254
mkdir -p /tmp/ipfs-meta

‎.github/workflows/publish-npm.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
id-token: write
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818

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

3030
- name: Setup Node
31-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v5
3232
with:
3333
node-version: "24"
3434
registry-url: "https://registry.npmjs.org"

‎scripts/build-production.sh‎

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,26 @@ NODE_ENV=production OPENSCAN_COMMIT_HASH=$COMMIT_HASH npm run build
2727
echo "Production build completed!"
2828
echo "Build output is in ./dist/"
2929

30-
# Get IPFS hash (ensure consistent chunking)
31-
ipfs add -r --chunker=size-262144 --raw-leaves=false ./dist
32-
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
33-
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)
34-
35-
echo "IPFS Hash (v0): $HASH"
36-
echo "IPFS Hash (v1): $HASH_V1"
37-
echo ""
38-
echo "IPFS URLs:"
39-
echo " - https://ipfs.io/ipfs/$HASH"
40-
echo " - https://cloudflare-ipfs.com/ipfs/$HASH"
41-
echo " - https://gateway.ipfs.io/ipfs/$HASH"
42-
echo ""
43-
echo "IPFS v1 URLs:"
44-
echo " - https://$HASH_V1.ipfs.dweb.link"
45-
echo " - https://$HASH_V1.ipfs.cf-ipfs.com"
30+
# Generate IPFS hash if ipfs CLI (Kubo) is available
31+
if command -v ipfs &> /dev/null; then
32+
echo ""
33+
echo "Generating IPFS hash..."
34+
HASH=$(ipfs add -r -Q --chunker=size-262144 --raw-leaves=false ./dist)
35+
HASH_V1=$(ipfs cid format -v 1 -b base32 $HASH)
36+
37+
echo "IPFS Hash (v0): $HASH"
38+
echo "IPFS Hash (v1): $HASH_V1"
39+
echo ""
40+
echo "IPFS URLs:"
41+
echo " - https://ipfs.io/ipfs/$HASH"
42+
echo " - https://cloudflare-ipfs.com/ipfs/$HASH"
43+
echo " - https://gateway.ipfs.io/ipfs/$HASH"
44+
echo ""
45+
echo "IPFS v1 URLs:"
46+
echo " - https://$HASH_V1.ipfs.dweb.link"
47+
echo " - https://$HASH_V1.ipfs.cf-ipfs.com"
48+
else
49+
echo ""
50+
echo "IPFS CLI (Kubo) not found. Skipping hash generation."
51+
echo "Install Kubo to generate IPFS hashes: https://docs.ipfs.tech/install/"
52+
fi

0 commit comments

Comments
 (0)