Skip to content

Commit

Permalink
Compile web assembly archive
Browse files Browse the repository at this point in the history
  • Loading branch information
frno7 committed Dec 30, 2024
1 parent 9683670 commit 6cba54a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6cba54a

Please sign in to comment.