Skip to content

Commit

Permalink
Filebase Initial Implementation [Draft] (#4)
Browse files Browse the repository at this point in the history
Adds Support for Filebase Pinning

Adds conditional tests for pinning to Pinata, Filebase, and Infura.
  • Loading branch information
jtsmedley authored Aug 18, 2022
1 parent 35d4657 commit 8d866ea
Show file tree
Hide file tree
Showing 12 changed files with 152,222 additions and 64,510 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Pin to Providers

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Publish Test [Pinata]
env:
PINATA_KEY: ${{ secrets.PINATA_KEY }}
if: "${{ env.PINATA_KEY != '' }}"
uses: ./
with:
path: 'dist'
service: 'pinata'
pinName: 'ipfs-action'
pinataKey: ${{ secrets.PINATA_KEY }}
pinataSecret: ${{ secrets.PINATA_SECRET }}

- name: Publish Test [Filebase]
env:
FILEBASE_BUCKET: ${{ secrets.FILEBASE_BUCKET }}
if: "${{ env.FILEBASE_BUCKET != '' }}"
uses: ./
with:
path: 'dist'
service: 'filebase'
pinName: 'ipfs-action'
filebaseBucket: ${{ secrets.FILEBASE_BUCKET }}
filebaseKey: ${{ secrets.FILEBASE_KEY }}
filebaseSecret: ${{ secrets.FILEBASE_SECRET }}

- name: Publish Test [Infura]
env:
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
if: "${{ env.INFURA_PROJECT_ID != '' }}"
uses: ./
with:
path: 'dist'
service: 'pinata'
pinName: 'ipfs-action'
infuraProjectId: ${{ secrets.INFURA_PROJECT_ID }}
infuraProjectSecret: ${{ secrets.INFURA_PROJECT_SECRET }}
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ IPFS upload GitHub Action. It allows uploading DApps or content to IPFS in a Git
</p>

## Inputs
Parameter |Required |Description
--- |--- |---
`path` |Yes |Directory's path to upload.
`service` |No |Type of target service to upload. Supported services [`ipfs`, `pinata`, `infura`]. Default `ipfs`
`timeout` |No |Request timeout. Default `60000` (1 minute)
`verbose` |No |Level of verbosity [`false` - quiet, `true` - verbose]. Default `false`
`host` |No |[ipfs] IPFS host. Default `ipfs.komputing.org`
`port` |No |[ipfs] IPFS host's port. Default `443`
`protocol` |No |[ipfs] IPFS host's protocol. Default `https`
`headers` |No |[ipfs] IPFS headers as json object. Default `{}`
`key` |No |[ipfs] IPNS key name. IPNS key will be published when the key parameter is provided. The key will be created if it does not exist. Default `undefined`
`pinataKey` |No |[pinata] API Key. Required for pinata service.
`pinataSecret` |No |[pinata] Secret Key. Required for pinata service.
`pinataPinName` |No |[pinata] Human name for pin.
Parameter |Required |Description
--- |--- |---
`path` |Yes |Directory's path to upload.
`service` |No |Type of target service to upload. Supported services [`ipfs`, `pinata`, `infura`, `filebase`]. Default `ipfs`
`timeout` |No |Request timeout. Default `60000` (1 minute)
`verbose` |No |Level of verbosity [`false` - quiet, `true` - verbose]. Default `false`
`host` |No |[ipfs] IPFS host. Default `ipfs.komputing.org`
`port` |No |[ipfs] IPFS host's port. Default `443`
`protocol` |No |[ipfs] IPFS host's protocol. Default `https`
`headers` |No |[ipfs] IPFS headers as json object. Default `{}`
`key` |No |[ipfs] IPNS key name. IPNS key will be published when the key parameter is provided. The key will be created if it does not exist. Default `undefined`
`pinName` |No |[psa] Human name for pin.
`pinataKey` |No |[pinata] Api Key. Required for pinata service.
`pinataSecret` |No |[pinata] Secret Api Key. Required for pinata service.
`pinataPinName` |No |[pinata] Human name for pin.
`filebaseBucket`|No |[filebase] Bucket to store pin in. Required for filebase service.
`filebaseKey` |No |[filebase] S3 Access Key. Required for filebase service.
`filebaseSecret`|No |[filebase] S3 Secret Key. Required for filebase service.
`infuraProjectId` |No |[infura] Project ID. Required for infura service.
`infuraProjectSecret` |No |[infura] Project Secret. Required for infura service.

## Outputs

- `hash` - IPFS CID
Expand Down Expand Up @@ -76,3 +79,15 @@ with:
infuraProjectId: ${{ secrets.INFURA_PROJECT_ID }}
infuraProjectSecret: ${{ secrets.INFURA_PROJECT_SECRET }}
```

### Filebase starter
```
uses: aquiladev/ipfs-action@v1
with:
path: ./build
service: filebase
pinName: 'ipfs-action'
filebaseBucket: ${{ secrets.FILEBASE_BUCKET }}
filebaseKey: ${{ secrets.FILEBASE_KEY }}
filebaseSecret: ${{ secrets.FILEBASE_SECRET }}
```
11 changes: 11 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ inputs:
pinataPinName:
description: '[pinata] Human name for pin'
required: false
pinName:
description: '[psa] Human name for pin'
required: false
filebaseBucket:
description: '[filebase] Bucket Name. Required for Filebase service'
required: false
filebaseKey:
description: '[filebase] Api Key. Required for Filebase service'
required: false
filebaseSecret:
description: '[filebase] Secret Api Key. Required for Filebase service'
infuraProjectId:
description: '[infura] Project ID. Required for infura service'
required: false
Expand Down
Loading

0 comments on commit 8d866ea

Please sign in to comment.