From 183fd698a98723758eb555d58e38a700d16e4de2 Mon Sep 17 00:00:00 2001 From: Jefferson Mantovani Date: Thu, 22 Jan 2026 10:52:37 -0300 Subject: [PATCH] chore: test pinata upload --- .github/workflows/ipfs-release.yml | 43 ++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ipfs-release.yml diff --git a/.github/workflows/ipfs-release.yml b/.github/workflows/ipfs-release.yml new file mode 100644 index 0000000..ec101d6 --- /dev/null +++ b/.github/workflows/ipfs-release.yml @@ -0,0 +1,43 @@ +name: Deploy to IPFS and Update Gist + +on: + push: + branches: + - release + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Install dependencies + run: npm ci + + - name: Build SPA + run: npm run build + + - name: Upload build output to Pinata (API) + id: pinata_upload + env: + PINATA_JWT: ${{ secrets.PINATA_JWT }} + run: | + VERSION=$(jq -r .version package.json) + zip -r dist.zip dist + RESPONSE=$(curl -sSL -X POST "https://api.pinata.cloud/pinning/pinFileToIPFS" \ + -H "Authorization: Bearer $PINATA_JWT" \ + -F "file=@dist.zip;type=application/zip" \ + -F "pinataMetadata={\"name\":\"p2pix_${VERSION}\"};type=application/json") + CID=$(echo "$RESPONSE" | jq -r .IpfsHash) + if [ -z "$CID" ] || [ "$CID" = "null" ]; then + echo "Error: Could not parse CID from Pinata API response. Aborting." + echo "Upload output: $RESPONSE" + exit 1 + fi + echo "CID=$CID" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/package.json b/package.json index 646d1ac..3c2ae62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p2pix-front-end", - "version": "1.1.0", + "version": "1.2.0", "scripts": { "start": "vite --host=0.0.0.0 --port 3000", "build": "run-p type-check build-only",