Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
X committed Aug 26, 2024
1 parent 1877c7a commit 74dcf89
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build the release binary image
run: make release
- name: Print the git commit and the binary hash
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ COPY . .

# Build
RUN make build

ENTRYPOINT [ "./release.sh" ]
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ fe:

release:
docker build -t beacon .
mkdir -p $(shell pwd)/release-artifacts
docker run --rm -v $(shell pwd)/release-artifacts:/target/wasm32-unknown-unknown/release beacon
make hashes

podman_release:
podman build -t beacon .
mkdir -p $(shell pwd)/release-artifacts
podman run --rm -v $(shell pwd)/release-artifacts:/target/wasm32-unknown-unknown/release beacon
make hashes

hashes:
git rev-parse HEAD
shasum -a 256 ./release-artifacts/beacon.wasm.gz | cut -d ' ' -f 1
shasum -a 256 $(shell pwd)/release-artifacts/beacon.wasm.gz | cut -d ' ' -f 1
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ echo "Features: $FEATURES"
for pkg in $1; do
cargo build -q --target wasm32-unknown-unknown --release --package $pkg --features "$FEATURES" --locked
WASM_FILE=target/wasm32-unknown-unknown/release/$pkg.wasm
candid-extractor $WASM_FILE > "src/backend/$pkg.did"
ic-wasm $WASM_FILE -o $WASM_FILE shrink
gzip -nf9v $WASM_FILE
done
3 changes: 3 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

make build
4 changes: 0 additions & 4 deletions src/backend/beacon.did
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ service : () -> {
http_request : (HttpRequest) -> (HttpResponse) query;
list_token : (principal) -> (Result);
orders : (principal, OrderType) -> (vec Order) query;
replace_canister_id : (principal, principal) -> ();
replace_user_id : (principal, principal) -> ();
set_payment_token : (principal) -> ();
set_revenue_account : (principal) -> ();
stable_mem_read : (nat64) -> (vec record { nat64; blob }) query;
stable_mem_write : (vec record { nat64; blob }) -> ();
stable_to_heap : () -> ();
trade : (principal, nat, nat, OrderType) -> (OrderExecution);
withdraw : (principal) -> (Result_1);
}

0 comments on commit 74dcf89

Please sign in to comment.