Skip to content

Commit

Permalink
update w3cli stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Dec 1, 2023
1 parent 1734c5d commit 8e0a6ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
id: build-cache
with:
path: build
key: ${{ runner.os }}-build
# Build hash should be based on runner.os, src files, and dependencies used.
key: ${{ runner.os }}-build-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }}
restore-keys: |
${{ runner.os }}-build
${{ runner.os }}-build-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }}
- name: Install dependencies
# We only need to install deps if build isn't cached.
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,31 @@ jobs:
ipfs dag export ${{ steps.ipfs.outputs.cid }} > ipfs-webui_${{ github.sha }}.car
echo "created car file"
# set w3cli principal from https://github.com/web3-storage/w3cli#w3_principal
export W3_PRINCIPAL=$W3_AGENT_PRINCIPAL
export W3_STORE_NAME="ipfs-webui-ci"
npx -y --package=@web3-storage/w3cli@latest -- w3 whoami
echo "got whoami"
echo $W3CLI_DELEGATION_PROOF_BASE64 | base64 -d > ipfs-webui-ci-space.ucan.proof
echo $W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING | base64 -d > ipfs-webui-ci-space.ucan.proof
echo "converted base64 env var to file"
npx -y --package=@web3-storage/w3cli@latest -- w3 space add ipfs-webui-ci-space.ucan.proof
npx -y --package=@web3-storage/w3cli@latest -- w3 proof add ipfs-webui-ci-space.ucan.proof
echo "added proof"
export W3CLI_SPACE_DID=$(npx -y --package=@web3-storage/w3cli@latest -- w3 space add ipfs-webui-ci-space.ucan.proof)
echo "added space"
npx -y --package=@web3-storage/w3cli@latest -- w3 space use $W3CLI_SPACE_DID
echo "using space"
npx -y --package=@web3-storage/w3cli@latest -- w3 up --no-wrap -c ipfs-webui_${{ github.sha }}.car
echo "uploaded car"
env:
W3_AGENT_DID: ${{ secrets.W3_AGENT_DID }}
W3_PRINCIPAL: ${{ secrets.W3_PRINCIPAL }}
W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING: ${{ secrets.W3CLI_SPACE_DELEGATION_PROOF_BASE64_STRING }}
# - name: Attach produced build to Github Action
# uses: actions/upload-artifact@v3
# with:
Expand Down

0 comments on commit 8e0a6ac

Please sign in to comment.