Add CI builder image and use it in the pipeline
builder.Dockerfile bakes the export step's dependencies into git.teletype.hu/internal/love-builder and pre-fetches love.js to /opt/lovejs.zip; the Makefile prefers the cached copy and falls back to downloading from GitHub outside the image. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,4 +29,20 @@ The pipeline uploads `$(PROJECT)-$(VERSION).love.zip`,
|
|||||||
the droparea, then triggers `/update` twice: once with `platform=love`
|
the droparea, then triggers `/update` twice: once with `platform=love`
|
||||||
(desktop package) and once with `platform=love-web` (web build).
|
(desktop package) and once with `platform=love-web` (web build).
|
||||||
|
|
||||||
|
## Builder image
|
||||||
|
|
||||||
|
`builder.Dockerfile` bakes the pipeline's export-step dependencies
|
||||||
|
(zip/unzip/curl/make + `luac` for the syntax check) into
|
||||||
|
`git.teletype.hu/internal/love-builder`, and pre-fetches love.js to
|
||||||
|
`/opt/lovejs.zip` — the Makefile uses the cached copy when present
|
||||||
|
and only falls back to downloading from GitHub outside the image:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build --platform linux/amd64 -f builder.Dockerfile \
|
||||||
|
-t git.teletype.hu/internal/love-builder:latest .
|
||||||
|
docker push git.teletype.hu/internal/love-builder:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Rebuild the image to pick up a newer love.js snapshot.
|
||||||
|
|
||||||
Detailed documentation lives on the wiki: `/development/love`.
|
Detailed documentation lives on the wiki: `/development/love`.
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# CI builder image for Love2D projects: packaging tools + luac syntax check,
|
||||||
|
# with love.js pre-fetched to /opt/lovejs.zip so `make web` does not hit
|
||||||
|
# GitHub on every pipeline run (the Makefile falls back to curl elsewhere).
|
||||||
|
#
|
||||||
|
# Build & push (the CI runner is linux/amd64):
|
||||||
|
# docker build --platform linux/amd64 -f builder.Dockerfile \
|
||||||
|
# -t git.teletype.hu/internal/love-builder:latest .
|
||||||
|
# docker push git.teletype.hu/internal/love-builder:latest
|
||||||
|
|
||||||
|
FROM alpine:3.22
|
||||||
|
|
||||||
|
RUN apk add --no-cache make zip unzip curl git lua5.4 \
|
||||||
|
&& ln -sf /usr/bin/lua5.4 /usr/bin/lua \
|
||||||
|
&& ln -sf /usr/bin/luac5.4 /usr/bin/luac
|
||||||
|
|
||||||
|
RUN curl -sSL https://github.com/2dengine/love.js/archive/refs/heads/master.zip \
|
||||||
|
-o /opt/lovejs.zip
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
CMD ["/bin/sh"]
|
||||||
+12
-2
@@ -14,6 +14,11 @@ OUTPUT_WEB_ZIP = $(PROJECT)-$(VERSION).html.zip
|
|||||||
|
|
||||||
VERSION_FILE = .version
|
VERSION_FILE = .version
|
||||||
|
|
||||||
|
# The love-builder CI image pre-fetches love.js here; local builds fall
|
||||||
|
# back to downloading it from GitHub.
|
||||||
|
LOVEJS_URL = https://github.com/2dengine/love.js/archive/refs/heads/master.zip
|
||||||
|
LOVEJS_CACHE = /opt/lovejs.zip
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -35,8 +40,13 @@ love:
|
|||||||
|
|
||||||
web: love
|
web: love
|
||||||
@mkdir -p $(WEB_DIR)
|
@mkdir -p $(WEB_DIR)
|
||||||
@echo "==> Downloading love.js (2dengine)"
|
@if [ -f $(LOVEJS_CACHE) ]; then \
|
||||||
curl -sSL https://github.com/2dengine/love.js/archive/refs/heads/master.zip -o $(DIST_DIR)/lovejs.zip
|
echo "==> Using cached love.js ($(LOVEJS_CACHE))"; \
|
||||||
|
cp $(LOVEJS_CACHE) $(DIST_DIR)/lovejs.zip; \
|
||||||
|
else \
|
||||||
|
echo "==> Downloading love.js (2dengine)"; \
|
||||||
|
curl -sSL $(LOVEJS_URL) -o $(DIST_DIR)/lovejs.zip; \
|
||||||
|
fi
|
||||||
unzip -o $(DIST_DIR)/lovejs.zip -d $(DIST_DIR)/lovejs-src
|
unzip -o $(DIST_DIR)/lovejs.zip -d $(DIST_DIR)/lovejs-src
|
||||||
rm -f $(DIST_DIR)/lovejs.zip
|
rm -f $(DIST_DIR)/lovejs.zip
|
||||||
@echo "==> Assembling web bundle"
|
@echo "==> Assembling web bundle"
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ steps:
|
|||||||
- make ci-version
|
- make ci-version
|
||||||
|
|
||||||
- name: export
|
- name: export
|
||||||
image: alpine
|
image: git.teletype.hu/internal/love-builder:latest
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache zip make curl unzip
|
|
||||||
- make ci-export
|
- make ci-export
|
||||||
|
|
||||||
- name: upload
|
- name: upload
|
||||||
|
|||||||
Reference in New Issue
Block a user