aboutsummaryrefslogtreecommitdiff
path: root/deps/raylib/.github/workflows/webassembly.yml
diff options
context:
space:
mode:
Diffstat (limited to 'deps/raylib/.github/workflows/webassembly.yml')
-rw-r--r--deps/raylib/.github/workflows/webassembly.yml83
1 files changed, 83 insertions, 0 deletions
diff --git a/deps/raylib/.github/workflows/webassembly.yml b/deps/raylib/.github/workflows/webassembly.yml
new file mode 100644
index 0000000..c3a3922
--- /dev/null
+++ b/deps/raylib/.github/workflows/webassembly.yml
@@ -0,0 +1,83 @@
+name: WebAssembly
+
+on:
+ workflow_dispatch:
+ push:
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - '.github/workflows/webassembly.yml'
+ pull_request:
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - '.github/workflows/webassembly.yml'
+ release:
+ types: [published]
+
+jobs:
+ build:
+ runs-on: windows-latest
+
+ env:
+ RELEASE_NAME: raylib-dev_webassembly
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+
+ - name: Setup emsdk
+ uses: mymindstorm/setup-emsdk@v14
+ with:
+ version: 3.1.71
+ actions-cache-folder: 'emsdk-cache'
+
+ - name: Setup Release Version
+ run: |
+ echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_webassembly" >> $GITHUB_ENV
+ shell: bash
+ if: github.event_name == 'release' && github.event.action == 'published'
+
+ - name: Setup Environment
+ run: |
+ mkdir build
+ cd build
+ mkdir ${{ env.RELEASE_NAME }}
+ cd ${{ env.RELEASE_NAME }}
+ mkdir include
+ mkdir lib
+ cd ../..
+
+ - name: Build Library
+ run: |
+ cd src
+ emcc -v
+ make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
+ cd ..
+
+ - name: Generate Artifacts
+ run: |
+ copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
+ copy /Y .\src\raymath.h .\build\${{ env.RELEASE_NAME }}\include\raymath.h
+ copy /Y .\src\rlgl.h .\build\${{ env.RELEASE_NAME }}\include\rlgl.h
+ copy /Y .\CHANGELOG .\build/${{ env.RELEASE_NAME }}\CHANGELOG
+ copy /Y .\README.md .\build\${{ env.RELEASE_NAME }}\README.md
+ copy /Y .\LICENSE .\build\${{ env.RELEASE_NAME }}\LICENSE
+ cd build
+ 7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
+ dir
+ shell: cmd
+
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: ${{ env.RELEASE_NAME }}.zip
+ path: ./build/${{ env.RELEASE_NAME }}.zip
+
+ - name: Upload Artifact to Release
+ uses: softprops/action-gh-release@v1
+ with:
+ files: ./build/${{ env.RELEASE_NAME }}.zip
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ if: github.event_name == 'release' && github.event.action == 'published'