From 6cba54af514c071911b48075f39f93d3c5075890 Mon Sep 17 00:00:00 2001 From: Fredrik Noring Date: Mon, 30 Dec 2024 05:43:45 +0100 Subject: [PATCH] Compile web assembly archive --- .github/workflows/compilation.yml | 44 ++++++++++++++++++++++++++----- README.md | 7 ++--- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 5c2d6b8..6351693 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -18,14 +18,16 @@ jobs: run: | echo "ARCHIVE_TAG=${GITHUB_REF_NAME}-${GITHUB_SHA:0:8}" >> $GITHUB_ENV + - name: Fix repository ownership problem + run: | + # Avoid fatal: unsafe repository (directory is owned by someone else) + # Confer https://github.com/actions/checkout/issues/760 + git config --global --add safe.directory "*" + - name: Compile PSGPLAY.TOS archive for the Atari ST env: TARGET_COMPILE: m68k-elf- run: | - # Avoid fatal: unsafe repository (directory is owned by someone else) - # Confer https://github.com/actions/checkout/issues/760 - git config --global --add safe.directory "$PWD" - git config --global --add safe.directory "$PWD"/lib/toslibc JOBS="$(getconf _NPROCESSORS_ONLN)" make -j"$JOBS" V=1 S=1 PSGPLAY.TOS @@ -38,6 +40,35 @@ jobs: compression-level: 9 path: PSGPLAY.TOS + build-web: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Archive tag + run: | + echo "ARCHIVE_TAG=${GITHUB_REF_NAME}-${GITHUB_SHA:0:8}" >> $GITHUB_ENV + + - uses: mymindstorm/setup-emsdk@v14 + + - name: Compile web assembly archive + run: | + JOBS="$(getconf _NPROCESSORS_ONLN)" + make -j"$JOBS" V=1 HOST_CC=emcc web + + - name: Publish web assembly archive + if: ${{ success() }} + uses: actions/upload-artifact@v4 + with: + name: "psgplay-web-${{ env.ARCHIVE_TAG }}" + if-no-files-found: error + compression-level: 9 + path: | + lib/psgplay/libpsgplay.js + lib/psgplay/libpsgplay.wasm + build-linux: strategy: fail-fast: false # 'false' means don't stop if some archs fail. @@ -66,8 +97,7 @@ jobs: run: | # Avoid fatal: unsafe repository (directory is owned by someone else) # Confer https://github.com/actions/checkout/issues/760 - git config --global --add safe.directory "$PWD" - git config --global --add safe.directory "$PWD"/lib/toslibc + git config --global --add safe.directory "*" JOBS="$(getconf _NPROCESSORS_ONLN)" make -j"$JOBS" V=1 ALSA=1 all test @@ -78,7 +108,7 @@ jobs: sudo apt-get install -q -y git make gcc libc-dev xxd libasound2 libasound2-dev JOBS="$(getconf _NPROCESSORS_ONLN)" make -j"$JOBS" V=1 S=1 ALSA=1 all test - make V=1 S=1 ALSA=1 clean + git clean -fdx make -j"$JOBS" V=1 ALSA=1 psgplay - name: Publish PSG play archive for Linux diff --git a/README.md b/README.md index 3736344..4ef0371 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,14 @@ The package [`media-sound/psgplay`](https://github.com/frno7/gentoo.overlay/tree/master/media-sound/psgplay) is available for [Gentoo Linux](https://www.gentoo.org/). -Github [actions](https://github.com/frno7/psgplay/actions) +Github [actions](https://github.com/frno7/psgplay/actions/workflows/compilation.yml) automatically compile and publish archives with PSG play for the [Atari ST](https://en.wikipedia.org/wiki/Atari_ST), as well as Linux and the architectures [`ppc64le`](https://en.wikipedia.org/wiki/ppc64le), -[`aarch64`](https://en.wikipedia.org/wiki/AArch64) and -[`x86-64`](https://en.wikipedia.org/wiki/X86-64). These are built with +[`aarch64`](https://en.wikipedia.org/wiki/AArch64), +[`x86-64`](https://en.wikipedia.org/wiki/X86-64) and +[`wasm`](https://en.wikipedia.org/wiki/WebAssembly). These are built with [`.github/workflows/compilation.yml`](https://github.com/frno7/psgplay/blob/master/.github/workflows/compilation.yml). # How to use