-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Add build target "web" #9406
Add build target "web" #9406
Conversation
Hi @ololoken , please fix code style issues in the code to make the pipeline happy. |
@ihhub Well, I didn't find better way than disable linter checks for places where js code is mixed in cpp files. |
Hi @ololoken please don't do these force-pushes. They completely break my changes. |
huh looks like ok, it's late in my location so, feel free to add your changes. I'll get back tomorrow ЗЫ можешь меня на lindkedin добавить? Roman |
Hi @ololoken please take a look at #9407. I've changed the
Я не использую linkedin уже давным-давно :) Даже учетку не вижу смысла восстанавливать чтобы войти. |
@ihhub LGTM Who is responsible for pipelines? make-web:
runs-on: ubuntu-latest
steps:
- name: Checkout ↓️
uses: actions/checkout@v4
- name: Install and Build ⚙
run: |
docker run --rm -v $(pwd):/src emscripten/emsdk:3.1.74 sh -c 'apt update && apt install -y gettext && emmake make -f Makefile.web'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' }}
with:
branch: fheroes2-gh-pages # The branch the action should deploy to.
folder: src/dist/web/dist # The folder the action should deploy. This requires enabled gh-pages in repo settings. The result is deployed build available via public url https://ihhub.github.io/fheroes2/ |
Hi @ololoken , every developer can contribute to GitHub Actions pipeline. Since you are the first time contributor you aren't allowed to run the pipeline as per GitHub rules. In order to add a new stage you need to add a new file inside .github/workflows directory and modify pull_request.yml and push.yml files. Additionally, you don't need to explicitly use docker commands. All GitHub Runners are Docker based images. |
BTW I don't see the |
@oleg-derevenetz dropped sdl2_mixer.py, left note how to build web version with enabled pthread. Local build is stable an redeployed here https://turch.in/fheroes2/public/ I will continue work on:
|
Hi @ololoken I implemented a few changes (please see my latest commit). Briefly:
I have a question BTW - I was unable to get your demo to work. It asks for a directory, I send it the directory with
and... nothing happens. Only these:
in the browser console. Why is that? P.S. In any case, if there will be any fixes for this issue, I suggest to wait for merging this PR and then address this issue later separately in new PRs. Hi @ihhub I suggest the following - now we can do a review and merge this PR (if review is OK) so that @ololoken will get his contributor badge and and there will be no need to run CI manually anymore. Then he will be able to gradually add new functionality via individual PRs from separate branches. |
@oleg-derevenetz expected directory structure: |
Yes, I specify my |
@oleg-derevenetz |
I suppose we will be able to bring threads back when emscripten-core/emscripten#23094 will be merged. Despite the fact that everything is more or less working now (except the MIDI playback), the logic of resuming background music is not working correctly, because it relies on a certain order of execution of interrelated actions due to synchronization between threads, namely - when playback of a music track is stopped, the stopping thread holds a mutex while it remembers the position of the music track and makes a proper cleanup, and only when this mutex is released, the other thread intended to restart the music track gets the chance to run. Now the logic is reversed (sort of) because there are no threads and no proper synchronization. But this issue is a relatively minor one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ololoken , I left 2 more questions here. Could you please check them?
I suggest deleting the edit history of this post because it still contains the link. |
MIDI music playback also works now. Now we can think about deploying the WASM engine with a demo version on GitHub Pages so that anyone can come and play the demo version (but first we need to resolve the issue with Hi @ihhub what specific issues are left with this PR? Let's solve them and merge this PR, so that @ololoken and, to some extent, I could gradually work on new WASM aspects in separate PRs. @ololoken will get the contributor badge and there will be no need for us to manually confirm all CI runs. |
latest build of this branch is deployed to https://turch.in/fheroes2/public/ |
Hi @ololoken
It looks like it is not the latest build yet - it still calls extra |
Indeed, an old build was uploaded, thanks. Updated. |
HI @ololoken and @oleg-derevenetz , I solved the remaining problems with files:
Please take a look. |
Ah, OK then. |
@ololoken , huge thanks for the contribution to the project! |
Prev PR for reference
Demo no files bundled and user can provide own sets of maps, music, mods;
@oleg-derevenetz would you check how synchronous playback is done in AsyncManager::notifyWorker, smelly workaround but it works;
BTW ci/cd pipeline can be done using gh-pages