generated from AbstractSDK/old-app-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
63 lines (48 loc) · 1.9 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Generate the schemas for the app contract
schema:
cargo schema
# Generate the schemas for this app and publish them to the schemas repository for access in the Abstract frontend
publish-schemas namespace name version: schema
#!/usr/bin/env bash
set -euxo pipefail
# Pre-run check for 'gh' CLI tool
if ! command -v gh &> /dev/null; then \
echo "'gh' could not be found. Please install GitHub CLI."; exit; \
fi
# check that the metadata exists
if [ ! -e "./metadata.json" ]; then \
echo "Please create metadata.json for module metadata"; exit; \
fi
tmp_dir="$(mktemp -d)"
schema_out_dir="$tmp_dir/{{namespace}}/{{name}}/{{version}}"
metadata_out_dir="$tmp_dir/{{namespace}}/{{name}}"
# Clone the repository to the temporary directory
git clone https://github.com/AbstractSDK/schemas "$tmp_dir"
# Create target directory structure and copy schemas
mkdir -p "$schema_out_dir"
cp -a "./schema/." "$schema_out_dir"
# Copy metadata.json to the target directory
cp "./metadata.json" "$metadata_out_dir"
# Create a new branch with a name based on the inputs
cd "$tmp_dir"
git checkout -b '{{namespace}}/{{name}}/{{version}}'
# Stage all new and changed files for commit
git add .
# Commit the changes with a message
git commit -m 'Add schemas for {{namespace}} {{name}} {{version}}'
# Create a pull request using 'gh' CLI tool
gh pr create --title 'Add schemas for {{namespace}} {{name}} {{version}}' --body ""
wasm:
#!/usr/bin/env bash
# Delete all the current wasms first
rm -rf ./artifacts/*.wasm
if [[ $(arch) == "arm64" ]]; then
image="cosmwasm/rust-optimizer-arm64"
else
image="cosmwasm/rust-optimizer"
fi
# Optimized builds
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
${image}:0.12.13