Skip to content

Commit

Permalink
fix: added ipfs CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jul 31, 2024
1 parent c623f37 commit 0388d62
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ipfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Ipfs uploader
# Uploads all changed svg files to ipfs once merged to main

concurrency:
group: ${{ github.workflow }}

on:
push:
branches:
- main

jobs:
ipfs-upload:
runs-on: ubuntu-latest
name: Ipfs uploader
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Install PNPM
run: npm i -g pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Get all changed *.svg file(s)
id: changed-files
uses: tj-actions/changed-files@f569b77fb1d9ad9f1a125757d7e9e07b1f320199
with:
json: true
write_output_files: true
files: |
icons/**/*.svg
- name: Run step if any *.md file(s) change
if: steps.changed-files.outputs.any_changed == 'true'
run: |
cat .github/outputs/all_changed_files.json
- name: Upload
if: steps.changed-files.outputs.any_changed == 'true'
env:
PINATA_KEY: ${{ secrets.PINATA_KEY }}
PINATA_SECRET: ${{ secrets.PINATA_SECRET }}
run: |
json_array=($(jq -r '.[]' ".github/outputs/all_changed_files.json"))
for i in "${json_array[@]}"
do
yarn ci:upload $i
done
4 changes: 3 additions & 1 deletion .github/workflows/release-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
contains(github.event.head_commit.message, 'chore(main): release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
},
"homepage": "https://github.com/bgd-labs/icons/blob/main/README.md",
"scripts": {
"generate": "tsx src/scripts/generate.ts && svg-to-ts-files --config ./src/utils/genereteMonoTokensConfig.js && svg-to-ts-files --config ./src/utils/genereteFullTokensConfig.js"
"generate": "tsx src/scripts/generate.ts && svg-to-ts-files --config ./src/utils/genereteMonoTokensConfig.js && svg-to-ts-files --config ./src/utils/genereteFullTokensConfig.js",
"ci:upload": "tsx src/scripts/uploadToIpfs.ts"
},
"devDependencies": {
"@bgd-labs/js-utils": "1.3.1-f95274c470a773ac8d045db51b6af0769e743f0a.0",
"@types/node": "^20.14.10",
"eslint": "^9.6.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
Loading

0 comments on commit 0388d62

Please sign in to comment.