feat(builtin-package): use new blueprint (#81)

This commit is contained in:
Aleksey Proshutisnkiy 2023-05-08 17:42:29 +04:00 committed by GitHub
parent dce5e1d26f
commit 4ce8e8bce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 14 deletions

View File

@ -161,6 +161,9 @@ jobs:
--yes --yes
continue-on-error: true continue-on-error: true
- name: Install ipfs
uses: nahsi/setup-ipfs@v1
- name: Create builtin distribution package - name: Create builtin distribution package
run: ./builtin-package/package.sh run: ./builtin-package/package.sh

View File

@ -58,6 +58,9 @@ jobs:
NEXTEST_TEST_THREADS: 10 NEXTEST_TEST_THREADS: 10
run: cargo nextest run --release --all-features --no-fail-fast run: cargo nextest run --release --all-features --no-fail-fast
- name: Install ipfs
uses: nahsi/setup-ipfs@v1
- name: Create distribution package - name: Create distribution package
run: ./builtin-package/package.sh run: ./builtin-package/package.sh

View File

@ -1,7 +0,0 @@
{
"name": "ipfs",
"dependencies": [
"name:ipfs_effector",
"name:ipfs_pure"
]
}

View File

@ -3,21 +3,39 @@ set -o pipefail -o nounset -o errexit
# set current working directory to script directory to run script from everywhere # set current working directory to script directory to run script from everywhere
cd "$(dirname "$0")" cd "$(dirname "$0")"
SCRIPT_DIR="$(pwd)" PACKAGE_DIR="$(pwd)/../aqua-ipfs"
(
rm -rf $PACKAGE_DIR/*
mkdir -p $PACKAGE_DIR
)
( (
echo "*** copy wasm files ***" echo "*** copy wasm files ***"
cd ../service cd ../service
cp artifacts/*.wasm "$SCRIPT_DIR" cp artifacts/*.wasm "$PACKAGE_DIR"
) )
(
echo "*** copy on_start script ***"
cp on_start.json "$PACKAGE_DIR"
cp on_start.air "$PACKAGE_DIR"
)
PURE_CID=$(ipfs add -q --only-hash --cid-version=1 --chunker=size-262144 $PACKAGE_DIR/ipfs_pure.wasm)
EFFECTOR_CID=$(ipfs add -q --only-hash --cid-version=1 --chunker=size-262144 $PACKAGE_DIR/ipfs_effector.wasm)
mv $PACKAGE_DIR/ipfs_pure.wasm "$PACKAGE_DIR"/"$PURE_CID".wasm
mv $PACKAGE_DIR/ipfs_effector.wasm "$PACKAGE_DIR"/"$EFFECTOR_CID".wasm
cp ipfs_pure_config.json "$PACKAGE_DIR"/"$PURE_CID"_config.json
cp ipfs_effector_config.json "$PACKAGE_DIR"/"$EFFECTOR_CID"_config.json
# write blueprint.json
echo "{}" | jq --arg pure_cid "$PURE_CID" --arg effector_cid "$EFFECTOR_CID" '{"name": "ipfs_pure", "dependencies":[{"/":$effector_cid},{"/":$pure_cid}]}' > "$PACKAGE_DIR/blueprint.json"
( (
echo "*** create builtin distribution package ***" echo "*** create builtin distribution package ***"
cd .. cd ..
mv builtin-package aqua-ipfs tar -f aqua-ipfs.tar.gz -zcvv ./aqua-ipfs
tar --exclude="package.sh" -f aqua-ipfs.tar.gz -zcvv ./aqua-ipfs
mv aqua-ipfs builtin-package
echo "*** package created ***"
) )
echo "*** done ***" echo "*** done ***"