mirror of
https://github.com/fluencelabs/trust-graph
synced 2024-12-04 15:20:19 +00:00
feat(builtin-package): use new blueprint (#94)
This commit is contained in:
parent
d567848cba
commit
a747b9cc75
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@ -105,6 +105,9 @@ jobs:
|
||||
run: npm publish --access public
|
||||
working-directory: aqua
|
||||
|
||||
- name: Install ipfs
|
||||
uses: nahsi/setup-ipfs@v1
|
||||
|
||||
- name: Create builtin distribution package
|
||||
if: needs.release-please.outputs.trust-graph-release-created
|
||||
run: ./builtin-package/package.sh
|
||||
|
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -58,6 +58,9 @@ jobs:
|
||||
- run: npm run build
|
||||
working-directory: aqua
|
||||
|
||||
- name: Install ipfs
|
||||
uses: nahsi/setup-ipfs@v1
|
||||
|
||||
- name: Create distribution package
|
||||
run: ./builtin-package/package.sh
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "trust-graph",
|
||||
"dependencies": [
|
||||
"name:sqlite3",
|
||||
"name:trust-graph"
|
||||
]
|
||||
}
|
@ -3,18 +3,39 @@ set -o pipefail -o nounset -o errexit
|
||||
|
||||
# set current working directory to script directory to run script from everywhere
|
||||
cd "$(dirname "$0")"
|
||||
SCRIPT_DIR="$(pwd)"
|
||||
PACKAGE_DIR="$(pwd)/../package"
|
||||
|
||||
(
|
||||
rm -f $PACKAGE_DIR/*
|
||||
mkdir -p $PACKAGE_DIR
|
||||
)
|
||||
|
||||
(
|
||||
echo "*** copy wasm files ***"
|
||||
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"
|
||||
)
|
||||
|
||||
TRUST_GRAPH_CID=$(ipfs add -q --only-hash --cid-version=1 --chunker=size-262144 $PACKAGE_DIR/trust-graph.wasm)
|
||||
SQLITE_CID=$(ipfs add -q --only-hash --cid-version=1 --chunker=size-262144 $PACKAGE_DIR/sqlite3.wasm)
|
||||
mv $PACKAGE_DIR/trust-graph.wasm "$PACKAGE_DIR"/"$TRUST_GRAPH_CID".wasm
|
||||
mv $PACKAGE_DIR/sqlite3.wasm "$PACKAGE_DIR"/"$SQLITE_CID".wasm
|
||||
cp trust-graph_config.json "$PACKAGE_DIR"/"$TRUST_GRAPH_CID"_config.json
|
||||
cp sqlite3_config.json "$PACKAGE_DIR"/"$SQLITE_CID"_config.json
|
||||
|
||||
# write blueprint.json
|
||||
echo "{}" | jq --arg trust_graph_cid "$TRUST_GRAPH_CID" --arg sqlite_cid "$SQLITE_CID" '{"name": "trust-graph", "dependencies":[{"/":$sqlite_cid},{"/":$trust_graph_cid}]}' > "$PACKAGE_DIR/blueprint.json"
|
||||
|
||||
(
|
||||
echo "*** create builtin distribution package ***"
|
||||
cd ..
|
||||
tar --exclude="package.sh" -f trust-graph.tar.gz -zcv --transform 's|builtin-package|trust-graph|' builtin-package
|
||||
cd $PACKAGE_DIR
|
||||
(tar cf - * | gzip) > ../trust-graph.tar.gz
|
||||
)
|
||||
|
||||
echo "*** done ***"
|
||||
|
Loading…
Reference in New Issue
Block a user