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

@@ -14,9 +14,29 @@ on:
env:
IMAGE_NAME: godot-ci
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:
name: Build Image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- 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' }}
build-mono:
name: Build Mono Image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [version]
steps:
- uses: actions/checkout@v3
- 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 }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:mono-${{ github.event.inputs.version }}${{ env.IMAGE_TAG }}
build-args: |
IMAGE=${{ needs.version.outputs.dotnet_version }}
GODOT_VERSION=${{ github.event.inputs.version }}
RELEASE_NAME=${{ github.event.inputs.release_name }}
SUBDIR=${{ github.event.inputs.release_name != 'stable' && format('/{0}', github.event.inputs.release_name) || '' }}