-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
86 lines (75 loc) · 2.5 KB
/
webassembly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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@v11
with:
version: 3.1.30
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@v3
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
- 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'