Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
X committed Aug 27, 2024
1 parent f7285a8 commit 7401722
Show file tree
Hide file tree
Showing 11 changed files with 1,449 additions and 623 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: 1 addition & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-nodejs
- uses: ./.github/actions/setup-ic-wasm

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.9.0
18.20.4
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
2,035 changes: 1,426 additions & 609 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"raw-loader": "4.0.2",
"ts-loader": "9.5.0",
"typescript": "5.2.2",
"webpack": "5.89.0",
"webpack": "5.93.0",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1"
"webpack-dev-server": "5.0.4"
},
"dependencies": {
"@dfinity/agent": "0.19.3",
Expand Down
9 changes: 9 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

export PATH=${HOME}/.local/share/dfx/bin:${PATH}

make start

# Since DFX is changing the binary around the deployment, we need to take the one used after the local deployment
dfx deploy
cp .dfx/local/canisters/beacon/beacon.wasm.gz target/wasm32-unknown-unknown/release/beacon.wasm.gz
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);
}
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ module.exports = {
// proxy /api to port 8000 during development
devServer: {
host: "localhost",
proxy: {
"/api": {
proxy: [
{
context: ["/api"],
target: "http://127.0.0.1:8080",
changeOrigin: true,
pathRewrite: {
"^/api": "/api",
},
},
},
],
hot: true,
watchFiles: [path.resolve(__dirname, "src", frontendDirectory)],
liveReload: true,
Expand Down

0 comments on commit 7401722

Please sign in to comment.