-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from kaydensigh/relative_path
Add Trunk.toml and make urls relative.
- Loading branch information
Showing
2 changed files
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -13,8 +13,7 @@ on: | |
|
||
# ToDo: adapt names | ||
env: | ||
# heads-up: this value is used as a pattern in an sed command as a workaround for a trunk issue | ||
# if you use special characters, take a look at the 'Make paths relative' step in the 'build-web' job | ||
# This variable is used to name release output files. | ||
GAME_EXECUTABLE_NAME: bevy_game | ||
GAME_OSX_APP_NAME: BevyGame | ||
|
||
|
@@ -196,12 +195,6 @@ jobs: | |
uses: NiklasEi/wasm-opt-action@v2 | ||
with: | ||
file: dist/*.wasm | ||
# Trunk cannot import assets from relative paths (see e.g. https://github.com/thedodd/trunk/issues/395) | ||
# On sites like itch.io, we don't know on which base path the game gets served, so we need to rewrite all links to be relative | ||
- name: Make paths relative | ||
run: | | ||
sed -i 's/\/index/.\/index/g' dist/index.html | ||
sed -i 's/\/${{ env.GAME_EXECUTABLE_NAME }}/.\/${{ env.GAME_EXECUTABLE_NAME }}/g' dist/index.html | ||
- name: Zip release | ||
uses: vimtor/[email protected] | ||
with: | ||
|
This file contains 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,5 @@ | ||
[build] | ||
public_url = "./" | ||
|
||
[serve] | ||
port = 8080 |