@@ -765,6 +765,78 @@ jobs:
765765 files : |
766766 *.zip
767767
768+ wasm-mini :
769+ runs-on : ubuntu-20.04
770+ steps :
771+ - uses : actions/checkout@v2
772+ with :
773+ submodules : recursive
774+ - name : Set up cache
775+ id : cache
776+ uses : actions/cache@v2
777+ with :
778+ path : |
779+ ~/emsdk
780+ */*.a
781+ build/CardinalFX
782+ build/plugins
783+ build/rack
784+ dpf/build
785+ src/Rack/dep/bin
786+ src/Rack/dep/include
787+ src/Rack/dep/lib
788+ src/Rack/dep/share
789+ src/Rack/dep/jansson-2.12
790+ src/Rack/dep/libarchive-3.4.3
791+ src/Rack/dep/libsamplerate-0.1.9
792+ src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
793+ src/Rack/dep/zstd-1.4.5
794+ key : wasm-mini-v${{ env.CACHE_VERSION }}
795+ - name : Set up dependencies
796+ run : |
797+ [ -e ~/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
798+ cd ~/emsdk && ./emsdk install latest && ./emsdk activate latest
799+ - name : Build wasm-mini cross-compiled
800+ env :
801+ AR : emar
802+ CC : emcc
803+ CXX : em++
804+ NM : emnm
805+ RANLIB : emranlib
806+ STRIP : emstrip
807+ run : |
808+ source ~/emsdk/emsdk_env.sh
809+ make features
810+ make CIBUILD=true NOPLUGINS=true STATIC_BUILD=true USE_GLES2=true -j $(nproc)
811+ - name : Set sha8 (non-release)
812+ if : startsWith(github.ref, 'refs/tags/') != true
813+ id : slug1
814+ run : echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
815+ - name : Set sha8 (release)
816+ if : startsWith(github.ref, 'refs/tags/')
817+ id : slug2
818+ run : echo "::set-output name=sha8::$(echo ${{ github.ref_name }})"
819+ - name : Set sha8
820+ id : slug
821+ run : echo "::set-output name=sha8::$(echo ${{ steps.slug1.outputs.sha8 || steps.slug2.outputs.sha8 }})"
822+ - name : Pack binaries
823+ run : |
824+ cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-mini-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}.zip $(ls *.html *.data *.js *.wasm)
825+ - uses : actions/upload-artifact@v2
826+ with :
827+ name : ${{ github.event.repository.name }}-wasm-mini-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
828+ path : |
829+ *.zip
830+ - uses : softprops/action-gh-release@v1
831+ if : startsWith(github.ref, 'refs/tags/')
832+ with :
833+ tag_name : ${{ github.ref_name }}
834+ name : ${{ github.ref_name }}
835+ draft : false
836+ prerelease : false
837+ files : |
838+ *.zip
839+
768840 win32 :
769841 runs-on : ubuntu-20.04
770842 steps :
0 commit comments