Skip to content

Commit

Permalink
refacto templates and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zapaz committed May 17, 2024
1 parent 4e1c694 commit fe69b09
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 54 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/deploy-wp-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,30 @@ jobs:

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4
with:
version: 8.5.1
version: 8.15.7

- name: Build wp plugin
run: pnpm deploy-plugin
run: pnpm deploy:plugin
env:
ENVIR: PROD
NODE_DEBUG: false
GIT_BRANCH: main
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
ALCHEMY_API_KEY_POLYGON: ${{ secrets.ALCHEMY_API_KEY_POLYGON }}
ALCHEMY_API_KEY_ARBITRUM: ${{ secrets.ALCHEMY_API_KEY_ARBITRUM }}
ALCHEMY_API_KEY_OPTIMISM: ${{ secrets.ALCHEMY_API_KEY_OPTIMISM }}
ALCHEMY_API_KEY_BASE: ${{ secrets.ALCHEMY_API_KEY_BASE }}
ANKR_API_KEY: ${{ secrets.ANKR_API_KEY }}
COVALENT_API_KEY: ${{ secrets.COVALENT_API_KEY }}
NFT_STORAGE_KEY: ${{ secrets.NFT_STORAGE_KEY }}

Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/test-forge.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
name: TEST forge
name: TEST Foundry Installation
on:
push:
branches:
- none

on: push

jobs:
check:
name: Test smartcontracts with forge
runs-on: ubuntu-22.04

name: Foundry project
runs-on: ubuntu-latest
steps:
- name: CHECKOUT kredeum nfts

uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
submodules: recursive

- name: INSTALL foundry
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: BUILD forge
working-directory: contracts
run: forge build
- run: forge --version

- name: TEST forge
working-directory: contracts
run: forge test -vvv
4 changes: 2 additions & 2 deletions config/src/config.handlebars.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": {
"latest": "1.6.0",
"stable": "1.6.0",
"latest": "1.6.2",
"stable": "1.6.2",
"branch": "{{GIT_BRANCH}}",
"commit": "{{GIT_COMMIT}}"
},
Expand Down
13 changes: 7 additions & 6 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
"main": "index.js",
"scripts": {
"clean": "forge clean && rm -rf cache-forge out node_modules lib types artifacts broadcast .turbo && git restore lib",
"postinstall": "pnpm install:foundry && pnpm forge:update",
"install:foundry": "command -v forge >/dev/null 2>&1 || pnpm foundry:install",
"postinstall": "pnpm forge:install && pnpm forge:update",
"build": "pnpm build:forge && pnpm build:typechain",
"build:forge": "$HOME/.foundry/bin/forge build",
"build:forge": "forge build",
"build:typechain": "typechain --target ethers-v5 --out-dir types out/**/*.json",
"check": "pnpm check:solidity",
"check:solidity": "solhint src/**/*.sol",
Expand All @@ -38,10 +37,12 @@
"deploy:all": "forge script scripts/DeployAllCurrent.s.sol",
"validate:only": "pnpm deploy:all --sender $SENDER",
"format": "pnpm format:solidity",
"format:solidity": "$HOME/.foundry/bin/forge fmt",
"foundry:install": "curl -L https://foundry.paradigm.xyz | bash && $HOME/.foundry/bin/foundryup",
"format:solidity": "forge fmt",
"foundryup:install": "command -v foundryup >/dev/null 2>&1 || curl -L https://foundry.paradigm.xyz | bash",
"forge:install": "command -v forge >/dev/null 2>&1 || (pnpm foundryup:install && PATH=$PATH:$HOME/.foundry/bin && foundryup)",
"forge:update": "git submodule update --recursive",
"tests": "pnpm tests:forge",
"tests:forge": "forge test"
}
}
}

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kredeum",
"version": "1.4.0",
"version": "1.6.2",
"main": "index.js",
"scripts": {
"clean": "pnpm -r clean && rm -rf node_modules .turbo web/dapp",
Expand Down Expand Up @@ -34,4 +34,4 @@
"turbo": "^1.13.3"
},
"type": "module"
}
}
15 changes: 9 additions & 6 deletions svelte/src/components/Collection/CollectionTemplates.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
[
"OpenNFTsV4/generic",
{
name: "OpenNFTs Generic",
name: "OpenNFTs",
description: "OpenNFTs generic Collection: anyone can Mint NFTs in this collection!",
icon: "building"
icon: "building",
network: "all"
}
],
[
"OpenNFTsV4Skale/generic",
{
name: "Skale OpenNFTs Generic",
name: "Skale OpenNFTs",
description: "OpenNFTs generic Skale Collection: anyone can Mint NFTs in this collection!",
icon: "building"
icon: "building",
network: "skale"
}
],
[
Expand All @@ -27,7 +29,8 @@
name: "AutoMarket",
description:
"AutoMarket ownable OpenNFTs Collection: own your collection, mint and sell your NFTs with royalties",
icon: "dollar-sign"
icon: "dollar-sign",
network: "all"
}
]
]);
Expand All @@ -41,7 +44,7 @@
<div class="titre">Choose your Collection type</div>
<div class="box-fields">
{#each [...templates] as [templateKey, templateValue]}
{#if templateConfig(templateKey) === "ownable"}
{#if templateValue.network === "all"}
<input
class="box-field collection-type"
id="collection-type-{templateKey}"
Expand Down
4 changes: 0 additions & 4 deletions wordpress/kredeum-nfts.handlebars.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/media-list/actions.php';
require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/media-list/column.php';

// require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/post-list/actions.php';
// require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/post-list/column.php';
// require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/post-list/article-content.php';

require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/settings/class-settings.php';
require_once KREDEUM_NFTS_PLUGIN_PATH . 'admin/settings/fields.php';

Expand Down
6 changes: 3 additions & 3 deletions wordpress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"install:composer": "composer install --prefer-dist --no-progress",
"install:vendor": "cd plugins/kredeum-nfts && composer install --prefer-dist --no-progress",
"plusinstall": "pnpm install:composer && pnpm install:vendor",
"config": "ts-node scripts/config.ts",
"check": "vendor/bin/phpcbf plugins/kredeum-nfts --ignore=vendor --extensions=php --standard=WordPress",
"format": "vendor/bin/phpcs plugins/kredeum-nfts -n --ignore=vendor --extensions=php --standard=WordPress",
"build": "ts-node scripts/build.ts"
"format": "vendor/bin/phpcs plugins/kredeum-nfts -n --ignore=vendor --extensions=php --standard=WordPress"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@kredeum/config": "workspace:^"
}
}
}
2 changes: 1 addition & 1 deletion wordpress/readme.handlebars.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ You can even add your NFTs in any websites you want by using Kredeum "Buy snippe


== Changelog ==
= 1.6.0 (stable & latest) =
= 1.6.2 (stable & latest) =
* New features :
* Many new deployments, mainly EVM L2s. Available mainnets:
* ethereum, arbitrum, optimism, scroll, base, mantle, mode, blast, polygon-zkevm
Expand Down
File renamed without changes.
27 changes: 19 additions & 8 deletions wordpress/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@
],
"outputMode": "new-only"
},
"config": {
"dependsOn": [
"plusinstall",
"@kredeum/config#build"
],
"inputs": [
"readme.handlebars.txt",
"kredeum-nfts.handlebars.php",
"!plugins/kredeum-nfts/readme.txt",
"!plugins/kredeum-nfts/kredeum-nfts.php"
],
"outputs": [
"plugins/kredeum-nfts/readme.txt",
"plugins/kredeum-nfts/kredeum-nfts.php"
]
},
"format": {
"dependsOn": [
"plusinstall"
"config"
],
"inputs": [
"plugins/kredeum-nfts/**"
Expand All @@ -31,15 +47,10 @@
"@kredeum/svelte#build"
],
"inputs": [
"plugins/kredeum-nfts/**",
"readme.handlebars.txt",
"kredeum-nfts.handlebars.php",
"!plugins/kredeum-nfts/readme.txt",
"!plugins/kredeum-nfts/kredeum-nfts.php"
"plugins/kredeum-nfts/**"
],
"outputs": [
"plugins/kredeum-nfts/readme.txt",
"plugins/kredeum-nfts/kredeum-nfts.php"
"plugins/kredeum-nfts/assets/**"
]
}
}
Expand Down

0 comments on commit fe69b09

Please sign in to comment.