Add interactable class and implement station #30
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: WebAssembly | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'src/**' | |
- '.github/workflows/webassembly.yml' | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
env: | |
PROJECT_NAME: ${{ github.event.repository.name }} | |
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_web | |
PROJECT_CUSTOM_FLAGS: "" | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@master | |
with: | |
path: ${{ env.PROJECT_NAME }} | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v13 | |
with: | |
version: 3.1.30 | |
actions-cache-folder: 'emsdk-cache' | |
- name: Setup Release Paths | |
run: | | |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_v${{ github.event.release.tag_name }}_web" >> $GITHUB_ENV | |
shell: bash | |
if: github.event_name == 'release' && github.event.action == 'published' | |
- name: Setup Environment | |
run: | | |
mkdir ${{ env.PROJECT_RELEASE_PATH }} | |
ls | |
shell: bash | |
- name: Build Product | |
run: | | |
cd ${{ env.PROJECT_NAME }} | |
emcmake cmake -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -B build | |
cmake --build build | |
shell: bash | |
- name: Generate Artifacts | |
run: | | |
cp ${{ env.PROJECT_NAME }}/build/src/game.js ${{ env.PROJECT_RELEASE_PATH }} | |
cp ${{ env.PROJECT_NAME }}/build/src/game.wasm ${{ env.PROJECT_RELEASE_PATH }} | |
cp ${{ env.PROJECT_NAME }}/build/src/game.data ${{ env.PROJECT_RELEASE_PATH }} | |
cp ${{ env.PROJECT_NAME }}/src/main_page.html ${{ env.PROJECT_RELEASE_PATH }}/index.html | |
cp ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }} | |
cp ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }} | |
ls ${{ env.PROJECT_RELEASE_PATH }} | |
zip -r ./${{ env.PROJECT_RELEASE_PATH }}.zip ./${{ env.PROJECT_RELEASE_PATH }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PROJECT_RELEASE_PATH }}.zip | |
path: ./${{ env.PROJECT_RELEASE_PATH }}.zip | |
- name: Upload Artifact to Release | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_name: ${{ env.PROJECT_RELEASE_PATH }}.zip | |
asset_path: ./${{ env.PROJECT_RELEASE_PATH }}.zip | |
asset_content_type: application/zip | |
if: github.event_name == 'release' && github.event.action == 'published' |