|
40 | 40 | - name: Download build artifact
|
41 | 41 | uses: actions/download-artifact@v3
|
42 | 42 | with:
|
43 |
| - name: ipfs-webui_${{ github.sha }}-build |
| 43 | + name: ipfs-webui_${{ github.sha }}-${{ runner.os }}-build |
44 | 44 | path: build
|
45 | 45 |
|
46 | 46 | - name: Cache bigger downloads
|
@@ -85,19 +85,38 @@ jobs:
|
85 | 85 | path: ipfs-webui_${{ github.sha }}.car
|
86 | 86 | if-no-files-found: error
|
87 | 87 |
|
88 |
| - - name: Pin to estuary.tech |
89 |
| - id: pin-estuary |
| 88 | + # Instructions for this are at https://github.com/ipfs/ipfs-webui/issues/2161#issuecomment-1836835068 |
| 89 | + - name: Pin to web3.storage with w3cli |
| 90 | + id: pin-w3up |
| 91 | + # only pin for main commits |
| 92 | + if: github.ref == 'refs/heads/main' |
90 | 93 | continue-on-error: true
|
91 | 94 | run: |
|
92 |
| - curl -X POST https://api.estuary.tech/pinning/pins -d '{ "name": "'$PIN_NAME'", "cid": "'$PIN_CID'" }' -H "Content-Type: application/json" -H "Authorization: Bearer $ESTUARY_API_TOKEN" |
93 |
| - curl -X GET https://api.estuary.tech/pinning/pins -H "Content-Type: application/json" -H "Authorization: Bearer $ESTUARY_API_TOKEN" |
| 95 | + # ensure whoami |
| 96 | + npx -y --package=@web3-storage/w3cli@latest -- w3 whoami |
| 97 | +
|
| 98 | + # convert base64 env var to file |
| 99 | + echo $W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING | base64 -d > ipfs-webui-ci-space.ucan.proof |
| 100 | +
|
| 101 | + # Add space |
| 102 | + export W3CLI_SPACE_DID=$(npx -y --package=@web3-storage/w3cli@latest -- w3 space add ipfs-webui-ci-space.ucan.proof) |
| 103 | +
|
| 104 | + # use space |
| 105 | + npx -y --package=@web3-storage/w3cli@latest -- w3 space use $W3CLI_SPACE_DID |
| 106 | +
|
| 107 | + # upload car |
| 108 | + npx -y --package=@web3-storage/w3cli@latest -- w3 up --no-wrap -c ipfs-webui_${{ github.sha }}.car |
94 | 109 | env:
|
95 |
| - ESTUARY_API_TOKEN: ${{ secrets.ESTUARY_API_TOKEN }} |
96 |
| - PIN_CID: ${{ steps.ipfs.outputs.cid }} |
97 |
| - PIN_NAME: "ipfs-webui@${{ github.sha }}" |
| 110 | + W3_STORE_NAME: ipfs-webui-ci |
| 111 | + W3_AGENT_DID: ${{ secrets.W3_AGENT_DID }} |
| 112 | + # set w3cli principal from https://github.com/web3-storage/w3cli#w3_principal |
| 113 | + W3_PRINCIPAL: ${{ secrets.W3_AGENT_PRINCIPAL }} |
| 114 | + W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING: ${{ secrets.W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING }} |
98 | 115 |
|
99 | 116 | - name: Pin to ipfs-websites.collab.ipfscluster.io
|
100 | 117 | id: pin-cluster
|
| 118 | + # only pin for main commits |
| 119 | + if: github.ref == 'refs/heads/main' |
101 | 120 | continue-on-error: true
|
102 | 121 | run: |
|
103 | 122 | ipfs-cluster-ctl --enc=json \
|
@@ -125,7 +144,8 @@ jobs:
|
125 | 144 | PIN_NAME: "ipfs-webui@${{ github.sha }}"
|
126 | 145 |
|
127 | 146 | - name: Fail job due to pinning failure
|
128 |
| - if: steps.pin-estuary.outcome == 'failure' && steps.pin-cluster.outcome == 'failure' |
| 147 | + # only fail if pinning failed for main commits |
| 148 | + if: github.ref == 'refs/heads/main' && steps.pin-w3up.outcome == 'failure' && steps.pin-cluster.outcome == 'failure' |
129 | 149 | uses: actions/github-script@v6
|
130 | 150 | with:
|
131 | 151 | script: |
|
|
0 commit comments