initial commit
This commit is contained in:
commit
45df9024c1
|
@ -0,0 +1,10 @@
|
|||
# SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: ISC
|
||||
|
||||
.git
|
||||
.gitea
|
||||
.reuse
|
||||
LICENSES
|
||||
LICENSE.md
|
||||
README.md
|
|
@ -0,0 +1,100 @@
|
|||
# SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: ISC
|
||||
|
||||
name: Build Container Image
|
||||
run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 19 * * 2'
|
||||
jobs:
|
||||
build_amd64:
|
||||
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
|
||||
runs-on: nephnet-amd64
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://gitea.com/actions/checkout@v3
|
||||
- name: Docker Build
|
||||
run: |
|
||||
export BRANCH=${GITHUB_REF##*/}
|
||||
export BRANCH=${BRANCH:-master}
|
||||
docker pull code.nephatrine.net/nephnet/nxb-webassembly:${BRANCH}-amd64 || true
|
||||
docker build --pull -t code.nephatrine.net/nephnet/nxb-webassembly:${BRANCH}-amd64 --cache-from code.nephatrine.net/nephnet/nxb-webassembly:${BRANCH}-amd64 ${{ gitea.workspace }}
|
||||
- name: Docker Login
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
if: gitea.ref_name == 'master' || gitea.ref_name == ''
|
||||
with:
|
||||
registry: code.nephatrine.net
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PACKAGER_TOKEN }}
|
||||
- name: Docker Push
|
||||
if: gitea.ref_name == 'master' || gitea.ref_name == ''
|
||||
run: |
|
||||
docker push code.nephatrine.net/nephnet/nxb-webassembly:master-amd64
|
||||
- name: Notify Discord
|
||||
uses: https://github.com/sarisia/actions-status-discord@v1
|
||||
if: always()
|
||||
with:
|
||||
title: "Container Build (X86_64)"
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
|
||||
build_manifest:
|
||||
if: gitea.ref_name == 'master' || gitea.ref_name == ''
|
||||
needs: [build_amd64]
|
||||
runs-on: nephnet
|
||||
steps:
|
||||
- name: Docker Login
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
registry: code.nephatrine.net
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PACKAGER_TOKEN }}
|
||||
- name: Docker Manifest
|
||||
run: |
|
||||
docker manifest create code.nephatrine.net/nephnet/nxb-webassembly:latest --amend code.nephatrine.net/nephnet/nxb-webassembly:master-amd64
|
||||
docker manifest push --purge code.nephatrine.net/nephnet/nxb-webassembly:latest
|
||||
publish_amd64:
|
||||
if: gitea.ref_name == 'master' || gitea.ref_name == ''
|
||||
needs: [build_amd64]
|
||||
runs-on: nephnet-amd64
|
||||
steps:
|
||||
- name: Docker Login
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASS }}
|
||||
- name: Docker Push
|
||||
run: |
|
||||
docker pull code.nephatrine.net/nephnet/nxb-webassembly:master-amd64
|
||||
docker tag code.nephatrine.net/nephnet/nxb-webassembly:master-amd64 nephatrine/nxbuilder:webassembly-amd64
|
||||
docker push nephatrine/nxbuilder:webassembly-amd64
|
||||
docker rmi nephatrine/nxbuilder:webassembly-amd64
|
||||
publish_manifest:
|
||||
needs: [publish_amd64]
|
||||
runs-on: nephnet
|
||||
steps:
|
||||
- name: Check Base Image
|
||||
if: gitea.event_name == 'schedule'
|
||||
uses: https://github.com/lucacome/docker-image-update-checker@v1
|
||||
id: checkbase
|
||||
with:
|
||||
base-image: nephatrine/nxbuilder:llvm16
|
||||
image: nephatrine/nxbuilder:webassembly
|
||||
platforms: linux/amd64
|
||||
- name: Docker Login
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASS }}
|
||||
- name: Docker Manifest
|
||||
run: |
|
||||
docker manifest create nephatrine/nxbuilder:webassembly --amend nephatrine/nxbuilder:webassembly-amd64 --amend nephatrine/nxbuilder:webassembly-i386 --amend nephatrine/nxbuilder:webassembly-arm64v8
|
||||
docker manifest push --purge nephatrine/nxbuilder:webassembly
|
||||
- name: Notify Discord
|
||||
if: gitea.event_name != 'schedule' || steps.checkbase.outputs.needs-updating == 'true'
|
||||
uses: https://github.com/sarisia/actions-status-discord@v1
|
||||
with:
|
||||
title: "DockerHub: nxb-webassembly"
|
||||
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxbuilder/general).\nPull `nephatrine/nxbuilder:webassembly` for the newest image."
|
||||
nodetail: true
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
|
|
@ -0,0 +1,10 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: builder-webassembly
|
||||
Upstream-Contact: Daniel Wolf <nephatrine@gmail.com>
|
||||
Source: https://code.nephatrine.net/NephNET/builder-webassembly
|
||||
|
||||
# Sample paragraph, commented out:
|
||||
#
|
||||
# Files: src/*
|
||||
# Copyright: $YEAR $NAME <$CONTACT>
|
||||
# License: ...
|
|
@ -0,0 +1,33 @@
|
|||
# SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: ISC
|
||||
|
||||
FROM nephatrine/nxbuilder:debian
|
||||
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN echo "====== INSTALL EMSCRIPTEN ======" \
|
||||
&& apt-get update \
|
||||
&& apt-get -o Dpkg::Options::="--force-confnew" install -y --no-install-recommends emscripten \
|
||||
&& apt-get autoremove -y && apt-get clean \
|
||||
&& rm -rf /tmp/* /var/tmp/*
|
||||
|
||||
ENV WASI_VERSION=20
|
||||
RUN echo "====== INSTALL WASI-SDK ======" \
|
||||
&& cd /tmp \
|
||||
&& wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk_${WASI_VERSION}.0_$(dpkg --print-architecture).deb \
|
||||
&& dpkg -i wasi-sdk_${WASI_VERSION}.0_$(dpkg --print-architecture).deb \
|
||||
&& rm -rf /tmp/* /var/tmp/*
|
||||
ENV WASI_SDK_PREFIX=/opt/wasi-sdk
|
||||
|
||||
COPY override /
|
||||
RUN echo "====== TEST TOOLCHAINS ======" \
|
||||
&& echo "set(WASI 1)" >>/usr/share/$(ls /usr/share/ | egrep 'cmake-[0-9]' | tail -1)/Modules/Platform/WASI.cmake \
|
||||
&& git -C ${HOME} clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
|
||||
&& mkdir /tmp/build-emscripten && cd /tmp/build-emscripten \
|
||||
&& nxbuild-emscripten -GNinja ${HOME}/hello-test \
|
||||
&& ninja && file HelloTest \
|
||||
&& mkdir /tmp/build-wasi && cd /tmp/build-wasi \
|
||||
&& nxbuild-wasi -GNinja ${HOME}/hello-test \
|
||||
&& echo ninja \
|
||||
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
|
|
@ -0,0 +1,13 @@
|
|||
Copyright © 2023 Daniel Wolf <<nephatrine@gmail.com>>
|
||||
|
||||
**Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.**
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@ -0,0 +1,8 @@
|
|||
ISC License:
|
||||
|
||||
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
|
||||
Copyright (c) 1995-2003 by Internet Software Consortium
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@ -0,0 +1,43 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: ISC
|
||||
-->
|
||||
|
||||
[Git](https://code.nephatrine.net/NephNET/builder-webassembly/src/branch/master) |
|
||||
[Docker](https://hub.docker.com/r/nephatrine/nxbuilder/)
|
||||
|
||||
# NXBuilder
|
||||
|
||||
This docker image contains the C/C++ build environment I use for projects. It is
|
||||
intended to be used by a CI/CD service to perform builds and not kept running
|
||||
beyond that. It can also be used as a quick "cleanroom" to test builds in.
|
||||
|
||||
### Base OS:
|
||||
|
||||
- [Debian Linux](https://www.debian.org/)
|
||||
|
||||
### Compilers
|
||||
|
||||
- [Clang](https://clang.llvm.org/)
|
||||
- [GCC](https://gcc.gnu.org/)
|
||||
|
||||
### Cross-Compilers
|
||||
|
||||
- [emscripten](https://emscripten.org/)
|
||||
- [wasi-sdk](https://github.com/WebAssembly/wasi-sdk)
|
||||
|
||||
### Other Tools
|
||||
|
||||
- [CMake](https://cmake.org/)
|
||||
- [Doxygen](http://www.doxygen.nl/)
|
||||
- [M.CSS](https://mcss.mosra.cz/documentation/doxygen/)
|
||||
- [Ninja](https://ninja-build.org/)
|
||||
- [NPM](https://npmjs.com/)
|
||||
- [TeX Live](https://www.tug.org/texlive/)
|
||||
|
||||
You can spin up a quick temporary test container like this:
|
||||
|
||||
~~~
|
||||
docker run --rm -ti nephatrine/nxbuilder:webassembly /bin/bash
|
||||
~~~
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
# SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: ISC
|
||||
/usr/bin/cmake -DEMSCRIPTEN_SYSTEM_PROCESSOR="wasm32" -DCMAKE_TOOLCHAIN_FILE="/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake" $@
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
# SPDX-FileCopyrightText: 2023 Daniel Wolf <nephatrine@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: ISC
|
||||
/usr/bin/cmake -DWASI_SDK_PREFIX="${WASI_SDK_PREFIX}" -DCMAKE_TOOLCHAIN_FILE="${WASI_SDK_PREFIX}/share/cmake/wasi-sdk.cmake" $@
|
Loading…
Reference in New Issue