Skip to content

Commit 12f34cd

Browse files
committed
chore: Add wasm to the nightly binary deploys.
1 parent 1451029 commit 12f34cd

File tree

2 files changed

+65
-20
lines changed

2 files changed

+65
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,68 @@ jobs:
339339
replacesArtifacts: true
340340
token: ${{ secrets.GITHUB_TOKEN }}
341341
artifacts: "toxcore-nightly-android-${{ matrix.arch }}.tar.gz,toxcore-nightly-android-${{ matrix.arch }}.tar.gz.sha256"
342+
343+
build-wasm:
344+
name: WebAssembly
345+
needs: [update-nightly-tag]
346+
runs-on: ubuntu-24.04
347+
steps:
348+
- name: Set up Docker Buildx
349+
uses: docker/setup-buildx-action@v3
350+
- name: Login to DockerHub
351+
if: ${{ github.event_name == 'push' }}
352+
uses: docker/login-action@v3
353+
with:
354+
username: ${{ secrets.DOCKERHUB_USERNAME }}
355+
password: ${{ secrets.DOCKERHUB_TOKEN }}
356+
- name: Build and push
357+
uses: docker/build-push-action@v6
358+
with:
359+
file: other/docker/wasm/wasm.Dockerfile
360+
push: ${{ github.event_name == 'push' }}
361+
tags: toxchat/c-toxcore:wasm
362+
cache-from: type=registry,ref=toxchat/c-toxcore:wasm
363+
cache-to: type=inline
364+
outputs: type=docker
365+
- name: Extract wasm build
366+
run: docker run --rm --entrypoint tar toxchat/c-toxcore:wasm -C /wasm/bin -c libtoxcore.js libtoxcore.wasm >toxcore-wasm.tar
367+
- name: Upload artifacts
368+
uses: actions/upload-artifact@v4
369+
with:
370+
name: toxcore-wasm.tar
371+
path: toxcore-wasm.tar
372+
- name: Compress tarball
373+
run: gzip toxcore-wasm.tar
374+
- name: Get tag name for release file name
375+
if: contains(github.ref, 'refs/tags/v')
376+
id: get_version
377+
run: |
378+
VERSION="$(echo "$GITHUB_REF" | cut -d / -f 3)"
379+
echo "release_tarball=toxcore-$VERSION-wasm.tar.gz" >>$GITHUB_OUTPUT
380+
- name: Create tarball for release upload
381+
if: contains(github.ref, 'refs/tags/v')
382+
run: |
383+
cp toxcore-wasm.tar.gz "${{ steps.get_version.outputs.release_tarball }}"
384+
- name: Upload to versioned release
385+
if: contains(github.ref, 'refs/tags/v')
386+
uses: ncipollo/release-action@v1
387+
with:
388+
allowUpdates: true
389+
draft: true
390+
token: ${{ secrets.GITHUB_TOKEN }}
391+
artifacts: "${{ steps.get_version.outputs.release_tarball }}"
392+
- name: Create tarball for nightly upload
393+
run: |
394+
cp toxcore-wasm.tar.gz toxcore-nightly-wasm.tar.gz
395+
- name: Upload to nightly release
396+
uses: ncipollo/release-action@v1
397+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
398+
with:
399+
allowUpdates: true
400+
tag: nightly
401+
omitBodyDuringUpdate: true
402+
omitNameDuringUpdate: true
403+
prerelease: true
404+
replacesArtifacts: true
405+
token: ${{ secrets.GITHUB_TOKEN }}
406+
artifacts: "toxcore-nightly-wasm.tar.gz"

.github/workflows/docker.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,26 +98,6 @@ jobs:
9898
cache-from: type=registry,ref=toxchat/c-toxcore:fuzzer
9999
cache-to: type=inline
100100

101-
docker-toxcore-js:
102-
runs-on: ubuntu-latest
103-
steps:
104-
- name: Set up Docker Buildx
105-
uses: docker/setup-buildx-action@v3
106-
- name: Login to DockerHub
107-
if: ${{ github.event_name == 'push' }}
108-
uses: docker/login-action@v3
109-
with:
110-
username: ${{ secrets.DOCKERHUB_USERNAME }}
111-
password: ${{ secrets.DOCKERHUB_TOKEN }}
112-
- name: Build and push
113-
uses: docker/build-push-action@v5
114-
with:
115-
file: other/docker/wasm/wasm.Dockerfile
116-
push: ${{ github.event_name == 'push' }}
117-
tags: toxchat/c-toxcore:wasm
118-
cache-from: type=registry,ref=toxchat/c-toxcore:wasm
119-
cache-to: type=inline
120-
121101
docker-esp32:
122102
runs-on: ubuntu-latest
123103
steps:

0 commit comments

Comments
 (0)