summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/webassembly.yml57
1 files changed, 57 insertions, 0 deletions
diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml
new file mode 100644
index 00000000..2f6b5754
--- /dev/null
+++ b/.github/workflows/webassembly.yml
@@ -0,0 +1,57 @@
+name: WebAssembly
+
+on:
+ push:
+ pull_request:
+ release:
+ types: [published]
+
+jobs:
+ build:
+ runs-on: windows-latest
+
+ env:
+ RELEASE_NAME: raylib-3.1_wasm
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+
+ - 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
+ make PLATFORM=PLATFORM_WEB RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
+ cd ..
+
+ - name: Generate Artifacts
+ run: |
+ cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
+ cd build
+ tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
+
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ env.RELEASE_NAME }}.tar.gz
+ path: ./build/${{ env.RELEASE_NAME }}.tar.gz
+
+ - name: Upload Artifact to Release
+ uses: actions/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./build/${{ env.RELEASE_NAME }}.zip
+ asset_name: ${{ env.RELEASE_NAME }}.zip
+ asset_content_type: application/zip
+ if: github.event_name == 'release' && github.event.action == 'published'