2021-09-13 00:06:07 +02:00
|
|
|
# github workflow to automate builds
|
|
|
|
|
2021-09-13 04:00:37 +02:00
|
|
|
name: WebAssembly build
|
2021-09-13 00:06:07 +02:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
EM_VERSION: 2.0.29
|
|
|
|
EM_CACHE_FOLDER: 'emsdk-cache'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-09-13 04:00:37 +02:00
|
|
|
name: CMake, WebAssembly
|
2021-09-13 00:06:07 +02:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Fetch Git tags
|
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow --tags
|
|
|
|
|
|
|
|
- name: Setup emsdk
|
|
|
|
uses: mymindstorm/setup-emsdk@v10
|
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
|
|
|
|
- name: Create build environment
|
|
|
|
run: cmake -E make_directory ${{runner.workspace}}/embuild
|
|
|
|
|
2021-10-23 09:48:06 +02:00
|
|
|
- name: Cache celt
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/dependencies/celt-0061
|
|
|
|
${{runner.workspace}}/dependencies/celt-0110
|
|
|
|
${{runner.workspace}}/embuild/dependencies/celt-0061/libcelt/.libs
|
|
|
|
${{runner.workspace}}/embuild/dependencies/celt-0110/libcelt/.libs
|
|
|
|
key: wasm-celt-${{ hashFiles('cmake/dependencies/celt.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache ffmpeg
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/ffmpeg/bin/usr/local/include
|
|
|
|
${{runner.workspace}}/embuild/dependencies/ffmpeg/bin/usr/local/lib
|
|
|
|
key: wasm-ffmpeg-${{ hashFiles('cmake/dependencies/ffmpeg.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache atrac9
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/LibAtrac9/bin
|
|
|
|
key: wasm-atrac9-${{ hashFiles('cmake/dependencies/atrac9.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache g719
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/libg719_decode/libg719_decode.a
|
|
|
|
key: wasm-g719-${{ hashFiles('cmake/dependencies/g719.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache speex
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/speex/libspeex/.libs
|
|
|
|
key: wasm-speex-${{ hashFiles('cmake/dependencies/speex.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache ogg
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/ogg/libogg.a
|
|
|
|
${{runner.workspace}}/embuild/dependencies/ogg/include
|
|
|
|
key: wasm-ogg-${{ hashFiles('cmake/dependencies/ogg.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache vorbis
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/dependencies/vorbis/lib/*.a
|
|
|
|
key: wasm-vorbis-${{ hashFiles('cmake/dependencies/vorbis.cmake') }}
|
|
|
|
|
2021-09-13 00:06:07 +02:00
|
|
|
- name: Configure CMake
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{runner.workspace}}/embuild
|
|
|
|
run: emcmake cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{runner.workspace}}/embuild
|
|
|
|
shell: bash
|
|
|
|
run: emmake make
|
|
|
|
|
2021-09-13 04:00:37 +02:00
|
|
|
- name: Upload WebAssembly artifact
|
2021-09-13 00:06:07 +02:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/embuild/cli/vgmstream-cli.js
|
|
|
|
${{runner.workspace}}/embuild/cli/vgmstream-cli.wasm
|
|
|
|
name: vgmstream-wasm
|