From 7539dbbd0ae62fc47c79e4d47f8f439d5af2924f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 15:06:50 +0000 Subject: [PATCH 1/2] Move the Azure Pipelines builds to GitHub Actions The Azure DevOps organization ran out of free build minutes, so both Azure pipelines fail on every commit since #910. GitHub Actions now takes over their job: - windows.yml builds the solution on Windows and runs the tests, like azure-pipelines.yml did. - docker.yml verifies that the Docker image of src/Startup builds, like the "MUnique.OpenMU Docker" pipeline did. It doesn't push anything. The README build badges point to the new workflows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NzDFE3GAAd8LS25ibdKGbB --- .github/workflows/docker.yml | 19 ++++++++++++++++++ .github/workflows/windows.yml | 32 +++++++++++++++++++++++++++++++ README.md | 4 ++-- azure-pipelines.yml | 36 ----------------------------------- src/MUnique.OpenMU.sln | 3 ++- 5 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/windows.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..0ac839d8fd --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,19 @@ +name: Docker image + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + name: Build the Docker image + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + # Only verifies that the image can be built. Images are published to Docker Hub separately. + - name: Build + run: docker build --file src/Startup/Dockerfile --tag munique/openmu:ci src diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..e7f0ccc31e --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,32 @@ +name: Windows build and test + +on: + push: + branches: + - master + pull_request: + +jobs: + build-and-test: + name: Build and test on Windows + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Restore + run: dotnet restore + working-directory: src + + - name: Build + run: dotnet build --configuration Release --no-restore -p:ci=true + working-directory: src + + - name: Test + run: dotnet test --configuration Release --no-build + working-directory: src diff --git a/README.md b/README.md index dc5508e05b..1be12d21f6 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ | Platform |Build Status | |----------------|----------------------| -| Windows | ![Windows Build Status](https://dev.azure.com/MUnique/OpenMU/_apis/build/status/MUnique.OpenMU?branchName=master) | -| Linux (Docker) | [![Docker Build Status](https://dev.azure.com/MUnique/OpenMU/_apis/build/status/MUnique.OpenMU%20Docker?branchName=master)](https://hub.docker.com/r/munique/openmu) | +| Windows | [![Windows Build Status](https://github.com/MUnique/OpenMU/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/MUnique/OpenMU/actions/workflows/windows.yml) | +| Linux (Docker) | [![Docker Build Status](https://github.com/MUnique/OpenMU/actions/workflows/docker.yml/badge.svg?branch=master)](https://hub.docker.com/r/munique/openmu) | | NuGet Packages | | |----------------|---| diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index dc2185a7df..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,36 +0,0 @@ -# ASP.NET Core -# Build and test ASP.NET Core projects targeting .NET Core. -# Add steps that run tests, create a NuGet package, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core - -trigger: -- master - -pool: - vmImage: 'windows-2022' - -variables: - buildConfiguration: 'Release' - -steps: -- task: UseDotNet@2 - displayName: 'Install .NET Core SDK' - inputs: - version: 10.0.x - performMultiLevelLookup: true - includePreviewVersions: true # Required for preview versions - -- script: dotnet restore - workingDirectory: src - displayName: 'dotnet restore' - -- script: dotnet build --configuration $(buildConfiguration) -p:ci=true - workingDirectory: src - displayName: 'dotnet build $(buildConfiguration)' - -- task: DotNetCoreCLI@2 - displayName: 'dotnet test' - inputs: - command: test - projects: 'tests/*Tests/*.csproj' - arguments: '--configuration $(buildConfiguration) --no-build' diff --git a/src/MUnique.OpenMU.sln b/src/MUnique.OpenMU.sln index 98a8bb5491..8c78bd641f 100644 --- a/src/MUnique.OpenMU.sln +++ b/src/MUnique.OpenMU.sln @@ -46,7 +46,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig ..\.gitignore = ..\.gitignore - ..\azure-pipelines.yml = ..\azure-pipelines.yml + ..\.github\workflows\docker.yml = ..\.github\workflows\docker.yml + ..\.github\workflows\windows.yml = ..\.github\workflows\windows.yml Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props ..\.github\workflows\dotnetcore.yml = ..\.github\workflows\dotnetcore.yml From 1335e7db5f77701e2f458440e6e98a237af4daf0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 15:12:34 +0000 Subject: [PATCH 2/2] Run the tests on Linux and publish the Docker images on release tags - Drop the separate Windows workflow and run the tests of the whole solution in the existing .NET Core workflow instead. - The Docker workflow now builds all images (the all-in-one image and the distributed ones). For a v* tag, it builds them for amd64, arm64 and arm/v7 and pushes them to Docker Hub as and latest. This requires the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NzDFE3GAAd8LS25ibdKGbB --- .github/workflows/docker.yml | 71 +++++++++++++++++++++++++++++--- .github/workflows/dotnetcore.yml | 2 + .github/workflows/windows.yml | 32 -------------- README.md | 2 +- src/MUnique.OpenMU.sln | 1 - 5 files changed, 69 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0ac839d8fd..d23a6391cd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,19 +1,80 @@ -name: Docker image +name: Docker images + +# The images are built for every push to master and for pull requests, to verify that they can be built. +# When a version tag (e.g. v1.2.3) is pushed, they are built for all supported platforms and published +# to Docker Hub with the version (1.2.3) and 'latest' as tags. +# Publishing requires the repository secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN. on: push: branches: - master + tags: + - 'v*' pull_request: jobs: build: - name: Build the Docker image + name: ${{ matrix.image }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - image: openmu + dockerfile: src/Startup/Dockerfile + - image: openmu-admin + dockerfile: src/Dapr/AdminPanel.Host/Dockerfile + - image: openmu-chat + dockerfile: src/Dapr/ChatServer.Host/Dockerfile + - image: openmu-connect + dockerfile: src/Dapr/ConnectServer.Host/Dockerfile + - image: openmu-friend + dockerfile: src/Dapr/FriendServer.Host/Dockerfile + - image: openmu-game + dockerfile: src/Dapr/GameServer.Host/Dockerfile + - image: openmu-guild + dockerfile: src/Dapr/GuildServer.Host/Dockerfile + - image: openmu-login + dockerfile: src/Dapr/LoginServer.Host/Dockerfile + + env: + PUBLISH: ${{ startsWith(github.ref, 'refs/tags/v') }} + steps: - uses: actions/checkout@v4 - # Only verifies that the image can be built. Images are published to Docker Hub separately. - - name: Build - run: docker build --file src/Startup/Dockerfile --tag munique/openmu:ci src + - name: Set up QEMU + if: env.PUBLISH == 'true' + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + if: env.PUBLISH == 'true' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Determine the image tags + id: meta + uses: docker/metadata-action@v5 + with: + images: munique/${{ matrix.image }} + tags: | + type=semver,pattern={{version}} + type=ref,event=branch + type=ref,event=pr + + - name: Build and publish + uses: docker/build-push-action@v6 + with: + context: src + file: ${{ matrix.dockerfile }} + platforms: ${{ env.PUBLISH == 'true' && 'linux/amd64,linux/arm64,linux/arm/v7' || 'linux/amd64' }} + push: ${{ env.PUBLISH == 'true' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index f5ce6068f3..e26d9be1d8 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -15,3 +15,5 @@ jobs: dotnet-version: 10.0.x - name: Build with dotnet run: dotnet publish src/Startup/MUnique.OpenMU.Startup.csproj --configuration Release -p:ci=true + - name: Test with dotnet + run: dotnet test src/MUnique.OpenMU.sln --configuration Release -p:ci=true diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index e7f0ccc31e..0000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Windows build and test - -on: - push: - branches: - - master - pull_request: - -jobs: - build-and-test: - name: Build and test on Windows - runs-on: windows-2022 - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 10.0.x - - - name: Restore - run: dotnet restore - working-directory: src - - - name: Build - run: dotnet build --configuration Release --no-restore -p:ci=true - working-directory: src - - - name: Test - run: dotnet test --configuration Release --no-build - working-directory: src diff --git a/README.md b/README.md index 1be12d21f6..8976641ce1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ | Platform |Build Status | |----------------|----------------------| -| Windows | [![Windows Build Status](https://github.com/MUnique/OpenMU/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/MUnique/OpenMU/actions/workflows/windows.yml) | +| Linux | [![Build Status](https://github.com/MUnique/OpenMU/actions/workflows/dotnetcore.yml/badge.svg?branch=master)](https://github.com/MUnique/OpenMU/actions/workflows/dotnetcore.yml) | | Linux (Docker) | [![Docker Build Status](https://github.com/MUnique/OpenMU/actions/workflows/docker.yml/badge.svg?branch=master)](https://hub.docker.com/r/munique/openmu) | | NuGet Packages | | diff --git a/src/MUnique.OpenMU.sln b/src/MUnique.OpenMU.sln index 8c78bd641f..d2dd8e0be9 100644 --- a/src/MUnique.OpenMU.sln +++ b/src/MUnique.OpenMU.sln @@ -47,7 +47,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig ..\.gitignore = ..\.gitignore ..\.github\workflows\docker.yml = ..\.github\workflows\docker.yml - ..\.github\workflows\windows.yml = ..\.github\workflows\windows.yml Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props ..\.github\workflows\dotnetcore.yml = ..\.github\workflows\dotnetcore.yml