Fix a bug where when shortcut key is pressed, the gui button is not d… #21
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
name: CMake emsdk | |
on: | |
push: | |
branches: [ "master", "emscripten" ] | |
pull_request: | |
branches: [ "master" ] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Setup Environment | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v13 | |
with: | |
# Make sure to set a version number! | |
# latest as of when this file is added | |
version: 3.1.51 | |
# This is the name of the cache folder. | |
# The cache folder will be placed in the build directory, | |
# so make sure it doesn't conflict with anything! | |
actions-cache-folder: 'emsdk-cache' | |
- name: build | |
run: | | |
emcmake cmake -B ${{ github.workspace }}/build -DPLATFORM=Web | |
cmake --build ${{ github.workspace }}/build | |
- uses: actions/upload-artifact@v4 | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: emscripten_build | |
# A file, directory or wildcard pattern that describes what to upload | |
# Required. | |
path: | | |
${{ github.workspace }}/build/sokoban.* | |
# The desired behavior if no files are found using the provided path. | |
# Available Options: | |
# warn: Output a warning but do not fail the action | |
# error: Fail the action with an error message | |
# ignore: Do not output any warnings or errors, the action does not fail | |
# Optional. Default is 'warn' | |
if-no-files-found: error | |
# Duration after which artifact will expire in days. 0 means using default retention. | |
# Minimum 1 day. | |
# Maximum 90 days unless changed from the repository settings page. | |
# Optional. Defaults to repository settings. | |
retention-days: 30 | |
# The level of compression for Zlib to be applied to the artifact archive. | |
# The value can range from 0 to 9. | |
# For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. | |
# Optional. Default is '6' | |
compression-level: 6 | |
- name: create github artifact | |
run: | | |
cp ${{ github.workspace }}/src/github_page.html /tmp/index.html | |
cp ${{ github.workspace }}/build/sokoban.html /tmp | |
cp ${{ github.workspace }}/build/sokoban.js /tmp | |
cp ${{ github.workspace }}/build/sokoban.data /tmp | |
cp ${{ github.workspace }}/build/sokoban.wasm /tmp | |
# https://github.com/actions/deploy-pages/issues/203 | |
cd /tmp; tar cf artifact.tar ./index.html ./sokoban.html ./sokoban.js ./sokoban.data ./sokoban.wasm | |
- name: Upload github-page artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: github-pages | |
path: /tmp/artifact.tar | |
if-no-files-found: error | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |