Skip to content

Commit 44a780f

Browse files
compilation docker image
1 parent 5526e79 commit 44a780f

3 files changed

Lines changed: 86 additions & 0 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!shared
3+
!emscripten
4+
!.dockerignore
5+
!Dockerfile
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images
2+
3+
name: Build Docker Image
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build-docker-image:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
packages: write
21+
attestations: write
22+
id-token: write
23+
24+
steps:
25+
- uses: actions/checkout@v5
26+
- uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
- uses: docker/metadata-action@v5
32+
id: meta
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
- uses: docker/build-push-action@v6
36+
id: push
37+
with:
38+
context: .
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}
42+
- uses: actions/attest-build-provenance@v3
43+
with:
44+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
45+
subject-digest: ${{ steps.push.outputs.digest }}
46+
push-to-registry: true

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM docker.io/library/ubuntu:latest
2+
3+
WORKDIR /root/workdir/buildscripts
4+
COPY . .
5+
6+
RUN apt-get update
7+
RUN apt-get install -y git curl python3 xz-utils lbzip2 unzip
8+
WORKDIR /root/workdir/buildscripts/emscripten
9+
ENV TAR_OPTIONS="--no-same-owner"
10+
RUN bash ./1_download_library.sh
11+
RUN apt-get install -y autoconf pkg-config libtool build-essential cmake meson
12+
RUN bash ./2_build_toolchain.sh
13+
RUN bash ./3_cleanup.sh
14+
15+
WORKDIR /root/workdir
16+
RUN git clone https://github.com/EasyRPG/liblcf
17+
18+
WORKDIR /root/workdir/liblcf
19+
ENV EM_PKG_CONFIG_PATH=/root/workdir/buildscripts/emscripten/lib/pkgconfig
20+
RUN autoreconf -fi
21+
RUN bash -c "source /root/workdir/buildscripts/emscripten/emsdk-portable/emsdk_env.sh; \
22+
emconfigure ./configure --prefix=/root/workdir/buildscripts/emscripten --disable-shared"
23+
RUN make install
24+
25+
RUN apt-get install -y ninja-build ccache
26+
CMD bash -c "source /root/workdir/buildscripts/emscripten/emsdk-portable/emsdk_env.sh; \
27+
cd /root/workdir/ynoengine; \
28+
if [[ \"$NO_SIMD\" -eq 1 ]]; then \
29+
./cmake_build_nosimd.sh; \
30+
else \
31+
./cmake_build.sh; \
32+
fi; \
33+
cd build; \
34+
ninja"
35+

0 commit comments

Comments
 (0)