Skip to content

Commit daae818

Browse files
authored
Merge pull request #19 from ipfs/upload-artifact
feat: add ability to upload artifact
2 parents 68c1359 + 6b8f42e commit daae818

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The [composite action](https://docs.github.com/en/actions/sharing-automations/cr
1717
- 🚀 Uploads CAR file to either Storacha, IPFS Cluster, or Kubo
1818
- 📍 Optional pinning to Pinata
1919
- 💾 Optional CAR file upload to Filebase
20+
- 📤 CAR file attached to Github Action run Summary page
2021
- 💬 PR comment with CID and preview links
2122
- 🔗 Automatic preview links
2223
- ✅ Commit status updates
@@ -78,6 +79,7 @@ The signing key and proof will be used as [inputs](#inputs) to the action.
7879
| `filebase-access-key` | Filebase access key | - |
7980
| `filebase-secret-key` | Filebase secret key | - |
8081
| `set-github-status` | Set GitHub commit status and PR comments | `'true'` |
82+
| `upload-car-artifact` | Upload and publish the CAR file on GitHub Action Summary pages | `'true'` |
8183
| `cluster-retry-attempts` | Number of retry attempts for IPFS Cluster uploads | `'5'` |
8284
| `cluster-timeout-minutes` | Timeout in minutes for each IPFS Cluster upload attempt | `'2'` |
8385

action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ inputs:
6666
set-github-status:
6767
description: 'Set GitHub commit status and PR comments'
6868
default: 'true'
69+
upload-car-artifact:
70+
description: 'Upload the CAR file as a GitHub artifact'
71+
default: 'true'
72+
required: false
6973

7074
outputs:
7175
cid:
@@ -124,6 +128,24 @@ runs:
124128
echo $CID
125129
echo "✅ Merkleized path: \`${{ inputs.path-to-deploy }}\` into CAR file with root CID \`$CID\`" >> $GITHUB_STEP_SUMMARY
126130
131+
- name: CAR file artifact name
132+
if: ${{ inputs.upload-car-artifact != 'false' }}
133+
shell: bash
134+
run: |
135+
REPO_NAME=$(echo "${{ github.repository }}" | tr '/' '-')
136+
COMMIT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
137+
COMMIT_SHA_SHORT="${COMMIT_SHA:0:7}"
138+
echo "artifact_name=$REPO_NAME-$COMMIT_SHA_SHORT-${{ steps.merkleize.outputs.cid }}.car" >> "$GITHUB_ENV"
139+
140+
- name: CAR file artifact upload
141+
if: ${{ inputs.upload-car-artifact != 'false' }}
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: ${{ env.artifact_name }}
145+
path: build.car
146+
retention-days: 7
147+
if-no-files-found: error
148+
127149
- name: Configure and upload CAR to Storacha
128150
if: ${{ inputs.storacha-key != '' && inputs.storacha-proof != ''}}
129151
shell: bash

0 commit comments

Comments
 (0)