69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
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 emsdk
|
|
uses: mymindstorm/setup-emsdk@v6
|
|
with:
|
|
version: 2.0.0
|
|
actions-cache-folder: 'emsdk-cache'
|
|
|
|
- name: Test emsdk
|
|
run: emcc -v
|
|
|
|
- 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 EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-master" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
|
cd ..
|
|
|
|
- name: Generate Artifacts
|
|
run: |
|
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
|
cd build
|
|
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
|
|
dir
|
|
shell: cmd
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ env.RELEASE_NAME }}.zip
|
|
path: ./build/${{ env.RELEASE_NAME }}.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_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'
|