raylib/.github/workflows/webassembly.yml

73 lines
1.9 KiB
YAML
Raw Normal View History

2020-08-19 18:37:21 +03:00
name: WebAssembly
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
runs-on: windows-latest
env:
2020-08-21 13:53:04 +03:00
RELEASE_NAME: raylib-dev_webassembly
2020-08-19 18:37:21 +03:00
steps:
- name: Checkout
uses: actions/checkout@master
2020-08-19 18:54:52 +03:00
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v6
with:
version: 2.0.0
actions-cache-folder: 'emsdk-cache'
2020-08-21 14:03:15 +03:00
- name: Setup Release Version
run: |
echo "::set-env name=RELEASE_NAME::raylib-${{ github.event.release.tag_name }}_webassembly"
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
2020-08-19 18:37:21 +03:00
- 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
2020-08-20 13:03:07 +03:00
emcc -v
2020-08-19 19:08:09 +03:00
make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-master" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
2020-08-19 18:37:21 +03:00
cd ..
- name: Generate Artifacts
run: |
2020-08-19 19:46:39 +03:00
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
2020-08-19 18:37:21 +03:00
cd build
2020-08-19 19:46:39 +03:00
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
dir
shell: cmd
2020-08-19 18:37:21 +03:00
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
2020-08-19 19:46:39 +03:00
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
2020-08-19 18:37:21 +03:00
- 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'