Use dotnet image for Godot 4 (#106)

This commit is contained in:
Adrasteon
2025-03-07 22:40:58 +01:00
committed by GitHub
parent d68f7da1ee
commit f0c298633b
6 changed files with 52 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ on:
jobs: jobs:
fetch: fetch:
name: Fetch Latest Godot Engine Release name: Fetch Latest Godot Engine Release
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
outputs: outputs:
release_tag: ${{ steps.parse.outputs.tag }} release_tag: ${{ steps.parse.outputs.tag }}
steps: steps:
@@ -20,7 +20,7 @@ jobs:
echo "tag=$TAG" >> $GITHUB_OUTPUT echo "tag=$TAG" >> $GITHUB_OUTPUT
current: current:
name: Fetch Current Godot CI release name: Fetch Current Godot CI release
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
outputs: outputs:
release_tag: ${{ steps.parse.outputs.tag }} release_tag: ${{ steps.parse.outputs.tag }}
steps: steps:
@@ -32,7 +32,7 @@ jobs:
create: create:
needs: [fetch, current] needs: [fetch, current]
name: Create New Godot CI Release name: Create New Godot CI Release
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
if: needs.fetch.outputs.release_tag != needs.current.outputs.release_tag if: needs.fetch.outputs.release_tag != needs.current.outputs.release_tag
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@@ -11,7 +11,7 @@ env:
jobs: jobs:
export-windows: export-windows:
name: Windows Export name: Windows Export
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04 # Use 22.04 with godot 4
container: container:
image: barichello/godot-ci:4.3 image: barichello/godot-ci:4.3
steps: steps:
@@ -39,7 +39,7 @@ jobs:
export-linux: export-linux:
name: Linux Export name: Linux Export
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04 # Use 22.04 with godot 4
container: container:
image: barichello/godot-ci:4.3 image: barichello/godot-ci:4.3
steps: steps:
@@ -65,7 +65,7 @@ jobs:
export-web: export-web:
name: Web Export name: Web Export
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04 # Use 22.04 with godot 4
container: container:
image: barichello/godot-ci:4.3 image: barichello/godot-ci:4.3
steps: steps:
@@ -99,7 +99,7 @@ jobs:
export-mac: export-mac:
name: Mac Export name: Mac Export
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04 # Use 22.04 with godot 4
container: container:
image: barichello/godot-ci:4.3 image: barichello/godot-ci:4.3
steps: steps:

View File

@@ -14,9 +14,29 @@ on:
env: env:
IMAGE_NAME: godot-ci IMAGE_NAME: godot-ci
jobs: jobs:
version:
name: Get Version
runs-on: ubuntu-22.04
outputs:
dotnet_version: ${{ steps.calculate.outputs.dotnet_version }}
steps:
- id: calculate
run: |
MAJOR_VERSION=$(echo ${{ github.event.inputs.version }} | cut -c -1)
MINOR_VERSION=$(echo ${{ github.event.inputs.version }} | cut -c -3)
if [ "$MAJOR_VERSION" = "3" ]
then
echo "dotnet_version=mono:latest" >> $GITHUB_OUTPUT
elif [ "$MINOR_VERSION" = "4.0" ] || [ "$MINOR_VERSION" = "4.1" ] || [ "$MINOR_VERSION" = "4.2" ] || [ "$MINOR_VERSION" = "4.3" ]
then
echo "dotnet_version=mcr.microsoft.com/dotnet/sdk:6.0-jammy" >> $GITHUB_OUTPUT
else
echo "dotnet_version=mcr.microsoft.com/dotnet/sdk:8.0-jammy" >> $GITHUB_OUTPUT
fi
build: build:
name: Build Image name: Build Image
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: echo IMAGE_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - run: echo IMAGE_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
@@ -49,7 +69,8 @@ jobs:
GODOT_PLATFORM=${{ startsWith( github.event.inputs.version, '3.' ) && 'linux_headless.64' || 'linux.x86_64' }} GODOT_PLATFORM=${{ startsWith( github.event.inputs.version, '3.' ) && 'linux_headless.64' || 'linux.x86_64' }}
build-mono: build-mono:
name: Build Mono Image name: Build Mono Image
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: [version]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: echo IMAGE_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - run: echo IMAGE_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
@@ -75,6 +96,7 @@ jobs:
ghcr.io/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:mono-${{ github.event.inputs.version }}${{ env.IMAGE_TAG }} ghcr.io/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:mono-${{ github.event.inputs.version }}${{ env.IMAGE_TAG }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-${{ github.event.inputs.version }}${{ env.IMAGE_TAG }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-${{ github.event.inputs.version }}${{ env.IMAGE_TAG }}
build-args: | build-args: |
IMAGE=${{ needs.version.outputs.dotnet_version }}
GODOT_VERSION=${{ github.event.inputs.version }} GODOT_VERSION=${{ github.event.inputs.version }}
RELEASE_NAME=${{ github.event.inputs.release_name }} RELEASE_NAME=${{ github.event.inputs.release_name }}
SUBDIR=${{ github.event.inputs.release_name != 'stable' && format('/{0}', github.event.inputs.release_name) || '' }} SUBDIR=${{ github.event.inputs.release_name != 'stable' && format('/{0}', github.event.inputs.release_name) || '' }}

View File

@@ -7,19 +7,32 @@ env:
jobs: jobs:
version: version:
name: Get Version name: Get Version
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
outputs: outputs:
version: ${{ steps.calculate.outputs.version }} version: ${{ steps.calculate.outputs.version }}
release_name: ${{ steps.calculate.outputs.release_name }} release_name: ${{ steps.calculate.outputs.release_name }}
dotnet_version: ${{ steps.calculate.outputs.dotnet_version }}
steps: steps:
- id: calculate - id: calculate
run: | run: |
REF_NAME=${{ github.ref_name }} REF_NAME=${{ github.ref_name }}
echo "version=${REF_NAME%-*}" >> $GITHUB_OUTPUT echo "version=${REF_NAME%-*}" >> $GITHUB_OUTPUT
echo "release_name=${REF_NAME#*-}" >> $GITHUB_OUTPUT echo "release_name=${REF_NAME#*-}" >> $GITHUB_OUTPUT
MAJOR_VERSION=$(echo ${REF_NAME%-*} | cut -c -1)
MINOR_VERSION=$(echo ${REF_NAME%-*} | cut -c -3)
if [ "$MAJOR_VERSION" = "3" ]
then
echo "dotnet_version=mono:latest" >> $GITHUB_OUTPUT
elif [ "$MINOR_VERSION" = "4.0" ] || [ "$MINOR_VERSION" = "4.1" ] || [ "$MINOR_VERSION" = "4.2" ] || [ "$MINOR_VERSION" = "4.3" ]
then
echo "dotnet_version=mcr.microsoft.com/dotnet/sdk:6.0-jammy" >> $GITHUB_OUTPUT
else
echo "dotnet_version=mcr.microsoft.com/dotnet/sdk:8.0-jammy" >> $GITHUB_OUTPUT
fi
build: build:
name: Build Image name: Build Image
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: [version] needs: [version]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@@ -53,7 +66,7 @@ jobs:
GODOT_PLATFORM=${{ startsWith( needs.version.outputs.version, '3.' ) && 'linux_headless.64' || 'linux.x86_64' }} GODOT_PLATFORM=${{ startsWith( needs.version.outputs.version, '3.' ) && 'linux_headless.64' || 'linux.x86_64' }}
build-mono: build-mono:
name: Build Mono Image name: Build Mono Image
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
needs: [version] needs: [version]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@@ -81,6 +94,7 @@ jobs:
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-latest
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-${{ needs.version.outputs.version }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-${{ needs.version.outputs.version }}
build-args: | build-args: |
IMAGE=${{ needs.version.outputs.dotnet_version }}
GODOT_VERSION=${{ needs.version.outputs.version }} GODOT_VERSION=${{ needs.version.outputs.version }}
RELEASE_NAME=${{ needs.version.outputs.release_name }} RELEASE_NAME=${{ needs.version.outputs.release_name }}
ZIP_GODOT_PLATFORM=${{ startsWith( needs.version.outputs.version, '3.' ) && 'linux_headless_64' || 'linux_x86_64' }} ZIP_GODOT_PLATFORM=${{ startsWith( needs.version.outputs.version, '3.' ) && 'linux_headless_64' || 'linux_x86_64' }}

View File

@@ -35,7 +35,7 @@ ARG GODOT_PLATFORM="linux.x86_64"
RUN wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}.zip \ RUN wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}.zip \
&& wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_export_templates.tpz \ && wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_export_templates.tpz \
&& mkdir ~/.cache \ && mkdir -p ~/.cache \
&& mkdir -p ~/.config/godot \ && mkdir -p ~/.config/godot \
&& mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME} \ && mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME} \
&& unzip Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}.zip \ && unzip Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}.zip \

View File

@@ -1,4 +1,5 @@
FROM mono:latest ARG IMAGE="mcr.microsoft.com/dotnet/sdk:8.0-jammy"
FROM $IMAGE
LABEL author="https://github.com/aBARICHELLO/godot-ci/graphs/contributors" LABEL author="https://github.com/aBARICHELLO/godot-ci/graphs/contributors"
USER root USER root
@@ -8,8 +9,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
git \ git \
git-lfs \ git-lfs \
python \
python-openssl \
unzip \ unzip \
wget \ wget \
zip \ zip \
@@ -41,7 +40,7 @@ ARG GODOT_ZIP_PLATFORM="linux_x86_64"
RUN wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_${GODOT_ZIP_PLATFORM}.zip \ RUN wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_${GODOT_ZIP_PLATFORM}.zip \
&& wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_export_templates.tpz \ && wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${RELEASE_NAME}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_export_templates.tpz \
&& mkdir ~/.cache \ && mkdir -p ~/.cache \
&& mkdir -p ~/.config/godot \ && mkdir -p ~/.config/godot \
&& mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME}.mono \ && mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME}.mono \
&& unzip Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_${GODOT_ZIP_PLATFORM}.zip \ && unzip Godot_v${GODOT_VERSION}-${RELEASE_NAME}_mono_${GODOT_ZIP_PLATFORM}.zip \