Oops #166
Workflow file for this run
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-20.04 | |
env: | |
PROJECT_NAME: ${{ github.event.repository.name }} | |
PROJECT_RELEASE_PATH: ${{ github.event.repository.name }}_dev_wasm | |
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.51 | |
actions-cache-folder: 'emsdk-cache' | |
- name: Verify emsdk | |
run: emcc -v | |
- name: Setup Release Paths | |
run: | | |
echo "PROJECT_RELEASE_PATH=${{ env.PROJECT_NAME }}_${{ github.event.release.tag_name }}_linux_x64" >> $GITHUB_ENV | |
shell: bash | |
if: github.event_name == 'release' && github.event.action == 'published' | |
- 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 cmake | |
mkdir ${{ env.PROJECT_RELEASE_PATH }} | |
ls | |
shell: bash | |
- name: Build Product | |
run: | | |
cd ${{ env.PROJECT_NAME }} | |
mkdir build-web | |
cd build-web | |
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release | |
emmake make | |
- name: Generate Artifacts | |
run: | | |
ls ${{ env.PROJECT_NAME }} | |
cp -v ${{ env.PROJECT_NAME }}/build-web/${{ env.PROJECT_NAME }}.data ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.data | |
cp -v ${{ env.PROJECT_NAME }}/build-web/${{ env.PROJECT_NAME }}.wasm ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.wasm | |
cp -v ${{ env.PROJECT_NAME }}/build-web/${{ env.PROJECT_NAME }}.js ${{ env.PROJECT_RELEASE_PATH }}/${{ env.PROJECT_NAME }}.js | |
cp -v ${{ env.PROJECT_NAME }}/build-web/${{ env.PROJECT_NAME }}.html ${{ env.PROJECT_RELEASE_PATH }}/index.html | |
cp -v ${{ env.PROJECT_NAME }}/README.md ${{ env.PROJECT_RELEASE_PATH }}/README.md | |
cp -v ${{ env.PROJECT_NAME }}/LICENSE ${{ env.PROJECT_RELEASE_PATH }}/LICENSE | |
ls ${{ env.PROJECT_RELEASE_PATH }} | |
# 7z a -tzip -r ${{ env.PROJECT_RELEASE_PATH }}.zip ./${{ env.PROJECT_RELEASE_PATH }} | |
shell: bash | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PROJECT_RELEASE_PATH }} | |
path: ${{ env.PROJECT_RELEASE_PATH }} |