-
Notifications
You must be signed in to change notification settings - Fork 438
feat: migrate hosting examples to icp-cli + remove svelte-starter #1303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9e2a42c
chore: update .gitignore for icp-cli cache and package-lock.json
marc0olo 06ecfd8
chore: remove svelte-starter example
marc0olo f90d7b3
feat: migrate hosting/static-website to icp-cli
marc0olo 89bd433
feat: migrate hosting/godot-html5-template to icp-cli
marc0olo 64705ce
feat: migrate hosting/unity-webgl-template to icp-cli
marc0olo 89ef35f
feat: migrate hosting/photo-storage to icp-cli
marc0olo ad9c1e1
feat: add icp.yaml to ICP Ninja hosting examples
marc0olo abb4f1c
feat: migrate hosting/oisy-signer-demo to icp-cli
marc0olo 8941a38
ci: migrate hosting workflows to icp-cli
marc0olo 10df3d6
ci: install icp-cli in provision scripts
marc0olo 3996c08
fix: restore prebuild script for Ninja hosting examples
marc0olo 60c50b5
fix: update photo-storage README to reference @icp-sdk/canisters/assets
marc0olo 8d8de16
fix: address PR review — remove keywords, fix prerequisite order
marc0olo e1481e7
ci: add ICP_CLI_GITHUB_TOKEN to hosting workflows
marc0olo 4fc0982
ci: pre-download network launcher to avoid API rate limits
marc0olo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/bash | ||
| # Pre-download the icp-cli network launcher to avoid GitHub API rate limits. | ||
| # icp-cli v0.1.0 doesn't support ICP_CLI_GITHUB_TOKEN yet, so `icp network start` | ||
| # hits the unauthenticated GitHub API rate limit (60 req/hr) when fetching the | ||
| # latest launcher version. This script uses the authenticated `gh` CLI to get | ||
| # the version, downloads the binary directly, and sets ICP_CLI_NETWORK_LAUNCHER_PATH | ||
| # so icp-cli skips the API call entirely. | ||
| # | ||
| # Requires: GH_TOKEN env var (for authenticated GitHub API access via gh CLI) | ||
| # | ||
| # This workaround can be removed once icp-cli supports ICP_CLI_GITHUB_TOKEN. | ||
| set -ex | ||
|
|
||
| VERSION=$(gh release view --repo dfinity/icp-cli-network-launcher --json tagName -q .tagName) | ||
|
|
||
| ARCH=$(uname -m) | ||
| case "$ARCH" in | ||
| arm64|aarch64) ARCH="arm64" ;; | ||
| x86_64) ARCH="x86_64" ;; | ||
| *) echo "Unsupported architecture: $ARCH"; exit 1 ;; | ||
| esac | ||
|
|
||
| OS=$(uname -s) | ||
| case "$OS" in | ||
| Darwin) OS="darwin" ;; | ||
| Linux) OS="linux" ;; | ||
| *) echo "Unsupported OS: $OS"; exit 1 ;; | ||
| esac | ||
|
|
||
| TARBALL="icp-cli-network-launcher-${ARCH}-${OS}-${VERSION}" | ||
| URL="https://github.com/dfinity/icp-cli-network-launcher/releases/download/${VERSION}/${TARBALL}.tar.gz" | ||
|
|
||
| LAUNCHER_DIR="$HOME/.icp-cli-launcher" | ||
| mkdir -p "$LAUNCHER_DIR" | ||
| curl -sL "$URL" | tar xz -C "$LAUNCHER_DIR" | ||
|
|
||
| LAUNCHER_PATH="${LAUNCHER_DIR}/${TARBALL}/icp-cli-network-launcher" | ||
| chmod +x "$LAUNCHER_PATH" | ||
|
|
||
| echo "ICP_CLI_NETWORK_LAUNCHER_PATH=${LAUNCHER_PATH}" >> "$GITHUB_ENV" | ||
| echo "Network launcher ${VERSION} downloaded to ${LAUNCHER_PATH}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| .dfx/ | ||
| **/.icp/cache/ | ||
| build/ | ||
| node_modules/ | ||
| package-lock.json | ||
| dist/ | ||
| .DS_Store | ||
| _MACOSX | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,50 @@ | ||
| --- | ||
| keywords: [html5, html, godot, hosting, host a website, beginner] | ||
| --- | ||
|
|
||
| # Godot HTML5 sample | ||
|
|
||
| [View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/godot-html5-template) | ||
|
|
||
| ## Overview | ||
| The example shows how to deploy a Godot HTML5 build on the IC in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample. | ||
|
|
||
| This example project can be cloned, installed, and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same. | ||
| The example shows how to deploy a Godot HTML5 build on ICP in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample. | ||
|
|
||
| ## Prerequisites | ||
| ## Project structure | ||
|
|
||
| This example requires an installation of: | ||
| The `/frontend` folder contains the pre-built Godot HTML5 export. The frontend is deployed as an asset canister. | ||
|
|
||
| - [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/). | ||
| ## Prerequisites | ||
|
|
||
| - [x] Download and install [git](https://git-scm.com/downloads). | ||
| - [x] Install [icp-cli](https://cli.icp.build): `npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm` | ||
|
|
||
| ## Install | ||
|
|
||
| Clone the example dapp project: | ||
| Clone the example project: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/dfinity/examples | ||
| cd examples/hosting/godot-html5-template | ||
| ``` | ||
|
|
||
| ## Deployment | ||
| The local replica is started by running this command: | ||
|
|
||
| Start the local network: | ||
|
|
||
| ```bash | ||
| dfx start --background | ||
| icp network start -d | ||
| ``` | ||
|
|
||
| When the local replica is up and running, run this command to deploy the canisters: | ||
| Deploy the canisters: | ||
|
|
||
| ```bash | ||
| dfx deploy | ||
| icp deploy | ||
| ``` | ||
|
|
||
| The URL for the frontend depends on the canister ID. When deployed, the URL will look like this: | ||
|
|
||
| ``` | ||
| http://{canister_id}.localhost:8000 | ||
| ``` | ||
|
|
||
| If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this: `https://<canister-id>.raw.ic0.app`. | ||
| Stop the local network when done: | ||
|
|
||
| ## License | ||
| This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project. | ||
| ```bash | ||
| icp network stop | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| canisters: | ||
| - name: godot_html5_assets | ||
| recipe: | ||
| type: "@dfinity/asset-canister@v2.1.0" | ||
| configuration: | ||
| dir: dist | ||
| build: | ||
| - mkdir -p dist | ||
| - cp -r src/godot_html5_assets/assets/* dist/ | ||
| - cp -r src/godot_html5_assets/src/* dist/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.