Try new build container toolchain
Some checks failed
Publish Builder Images / build-and-push (push) Failing after 1m32s
Some checks failed
Publish Builder Images / build-and-push (push) Failing after 1m32s
This commit is contained in:
@ -1,6 +1,10 @@
|
|||||||
name: Publish Builder Image
|
name: Publish Builder Images
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
paths:
|
||||||
|
- 'Dockerfile.base'
|
||||||
|
- 'Dockerfile.windows'
|
||||||
|
- 'build.sh'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@ -9,17 +13,21 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Make script executable
|
||||||
|
run: chmod +x build.sh
|
||||||
|
|
||||||
|
# Optional: Restore DNF Cache (if you are using the cache strategy)
|
||||||
|
|
||||||
|
- name: Run Build Script
|
||||||
uses: docker://quay.io/buildah/stable
|
uses: docker://quay.io/buildah/stable
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ gitea.actor }}
|
# Standard Gitea env vars
|
||||||
|
USERNAME: ${{ gitea.repository_owner }}
|
||||||
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
||||||
REGISTRY: gitea.212.63.210.91.nip.io
|
REGISTRY: gitea.212.63.210.91.nip.io
|
||||||
# Changed to repository_owner to avoid 'owner/repo/image' nesting
|
|
||||||
IMAGE: ${{ gitea.repository_owner }}/godot-builder
|
# We use the short SHA for the tag
|
||||||
TAG: ${{ gitea.sha }}
|
TAG: ${{ gitea.sha }}
|
||||||
with:
|
with:
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
# We just tell it to run the script we checked out
|
args: ./build.sh
|
||||||
args: ./build.sh
|
|
||||||
|
|
||||||
13
Dockerfile.base
Normal file
13
Dockerfile.base
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM fedora:42
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
ENV DOTNET_NOLOGO=1
|
||||||
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||||
|
|
||||||
|
RUN dnf -y install --setopt=install_weak_deps=False \
|
||||||
|
bash binutils bzip2 curl file findutils gettext git make nano patch pkgconfig python3-pip unzip which xz \
|
||||||
|
dotnet-sdk-8.0 && \
|
||||||
|
pip install scons==4.9.1
|
||||||
|
|
||||||
|
CMD /bin/bash
|
||||||
13
Dockerfile.windows
Normal file
13
Dockerfile.windows
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ARG img_version
|
||||||
|
FROM godot-fedora:${img_version}
|
||||||
|
|
||||||
|
RUN dnf -y install --setopt=install_weak_deps=False \
|
||||||
|
mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static && \
|
||||||
|
export LLVM_MINGW_VERSION=20250528 && \
|
||||||
|
export LLVM_MINGW_NAME=llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-22.04-x86_64 && \
|
||||||
|
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/${LLVM_MINGW_NAME}.tar.xz && \
|
||||||
|
tar xf ${LLVM_MINGW_NAME}.tar.xz && \
|
||||||
|
rm -f ${LLVM_MINGW_NAME}.tar.xz && \
|
||||||
|
mv -f ${LLVM_MINGW_NAME} /root/llvm-mingw
|
||||||
|
|
||||||
|
CMD /bin/bash
|
||||||
72
build.sh
72
build.sh
@ -1,25 +1,69 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e # Exit immediately if a command fails
|
set -e # Stop on any error
|
||||||
|
|
||||||
# 1. Login to Gitea Registry
|
# --- Configuration ---
|
||||||
# We use the environment variables passed from the workflow
|
# 1. Image Names for your Registry
|
||||||
|
BASE_IMAGE_NAME="godot-builder-base"
|
||||||
|
WIN_IMAGE_NAME="godot-builder-windows"
|
||||||
|
|
||||||
|
# 2. Construct full registry paths
|
||||||
|
# Uses variables passed from the workflow env: $REGISTRY, $USERNAME, $TAG
|
||||||
|
FULL_BASE_TAG="$REGISTRY/$USERNAME/$BASE_IMAGE_NAME:$TAG"
|
||||||
|
LATEST_BASE_TAG="$REGISTRY/$USERNAME/$BASE_IMAGE_NAME:latest"
|
||||||
|
|
||||||
|
FULL_WIN_TAG="$REGISTRY/$USERNAME/$WIN_IMAGE_NAME:$TAG"
|
||||||
|
LATEST_WIN_TAG="$REGISTRY/$USERNAME/$WIN_IMAGE_NAME:latest"
|
||||||
|
|
||||||
|
# 3. Login
|
||||||
echo "Logging in to $REGISTRY..."
|
echo "Logging in to $REGISTRY..."
|
||||||
buildah login -u "$USERNAME" -p "$PASSWORD" --tls-verify=false --storage-driver=vfs "$REGISTRY"
|
buildah login -u "$USERNAME" -p "$PASSWORD" --tls-verify=false --storage-driver=vfs "$REGISTRY"
|
||||||
|
|
||||||
# 2. Build the Image
|
# --- STEP 1: Build Base Image ---
|
||||||
# We build both the specific SHA tag and the 'latest' tag
|
echo "---------------------------------------"
|
||||||
echo "Building image $IMAGE..."
|
echo "Building BASE image (Fedora)..."
|
||||||
|
echo "---------------------------------------"
|
||||||
|
|
||||||
|
# Build and tag for the registry
|
||||||
buildah build \
|
buildah build \
|
||||||
--tls-verify=false \
|
--tls-verify=false \
|
||||||
--storage-driver=vfs \
|
--storage-driver=vfs \
|
||||||
-f Dockerfile \
|
-f Dockerfile.base \
|
||||||
-t "$REGISTRY/$IMAGE:$TAG" \
|
-t "$FULL_BASE_TAG" \
|
||||||
-t "$REGISTRY/$IMAGE:latest" \
|
-t "$LATEST_BASE_TAG" \
|
||||||
.
|
.
|
||||||
|
|
||||||
# 3. Push the Images
|
# CRITICAL STEP: Create the local alias
|
||||||
echo "Pushing images..."
|
# The Windows Dockerfile expects "FROM godot-fedora:custom"
|
||||||
buildah push --tls-verify=false --storage-driver=vfs "$REGISTRY/$IMAGE:$TAG"
|
# So we tag our just-built image to match that expectation.
|
||||||
buildah push --tls-verify=false --storage-driver=vfs "$REGISTRY/$IMAGE:latest"
|
buildah tag "$FULL_BASE_TAG" "godot-fedora:custom"
|
||||||
|
|
||||||
echo "Done!"
|
# Push Base to registry (Checkpoint)
|
||||||
|
echo "Pushing Base image..."
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs "$FULL_BASE_TAG"
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs "$LATEST_BASE_TAG"
|
||||||
|
|
||||||
|
# --- STEP 2: Build Windows Image ---
|
||||||
|
echo "---------------------------------------"
|
||||||
|
echo "Building WINDOWS image..."
|
||||||
|
echo "---------------------------------------"
|
||||||
|
|
||||||
|
# We pass 'img_version=custom' to match the tag we just created.
|
||||||
|
buildah build \
|
||||||
|
--tls-verify=false \
|
||||||
|
--storage-driver=vfs \
|
||||||
|
--build-arg img_version=custom \
|
||||||
|
-f Dockerfile.windows \
|
||||||
|
-t "$FULL_WIN_TAG" \
|
||||||
|
-t "$LATEST_WIN_TAG" \
|
||||||
|
.
|
||||||
|
|
||||||
|
# Push Windows Image
|
||||||
|
echo "Pushing Windows image..."
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs "$FULL_WIN_TAG"
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs "$LATEST_WIN_TAG"
|
||||||
|
|
||||||
|
echo "---------------------------------------"
|
||||||
|
echo "SUCCESS!"
|
||||||
|
echo "Base Image: $FULL_BASE_TAG"
|
||||||
|
echo "Windows Image: $FULL_WIN_TAG"
|
||||||
|
echo "---------------------------------------"
|
||||||
Reference in New Issue
Block a user