From 69495abf01bac28d014aa78c94c082fb2d754d7a Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 11:03:45 -0500 Subject: [PATCH 1/6] Correct spacing --- src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs b/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs index 83d109c4250..6d819dfb337 100644 --- a/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs +++ b/src/Tgstation.Server.Host/Database/MySqlDatabaseContext.cs @@ -47,7 +47,7 @@ public static void ConfigureWith(DbContextOptionsBuilder options, DatabaseConfig databaseConfiguration.ServerVersion, databaseConfiguration.DatabaseType == DatabaseType.MariaDB ? ServerType.MariaDb - : ServerType.MySql); + : ServerType.MySql); } else serverVersion = ServerVersion.AutoDetect(databaseConfiguration.ConnectionString); From ad4946f8524325b18700a5a05b2ede9d5107342e Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 11:09:09 -0500 Subject: [PATCH 2/6] Lock SDK version used Tired of the .NET 8 RC fucking me over --- global.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 00000000000..e866df76d5a --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "6.0.0", + "rollForward": "latestMajor", + "allowPrerelease": false + } +} From 2fba0f4113446a6a455421e6f2c33a5550446c38 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 11:19:27 -0500 Subject: [PATCH 3/6] Host MariaDB ourselves - Locate using REST API. - Bump to 10.11.6. - Store in GitHub releases so older installers don't break. Closes #1633 --- .github/workflows/ci-pipeline.yml | 12 ++++++++++++ build/Version.props | 4 +--- ...tation.Server.Host.Service.Wix.Bundle.wixproj | 2 +- .../winget/prepare_installer_input_artifacts.ps1 | 16 +++++++++++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 87f48f09a10..d6df6849043 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1515,7 +1515,9 @@ jobs: run: | [XML]$versionXML = Get-Content build/Version.props $tgsVersion = $versionXML.Project.PropertyGroup.TgsCoreVersion + $mariaDBVerison = $versionXML.Project.PropertyGroup.TgsMariaDBRedistVersion echo "TGS_VERSION=$tgsVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + echo "MARIADB_VERSION=$mariaDBVerison" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - name: Upload .msi uses: actions/upload-artifact@v3 @@ -1657,6 +1659,16 @@ jobs: asset_name: tgstation-server-v${{ env.TGS_VERSION }}.debian.packaging.tar.xz asset_content_type: application/x-tar + - name: Upload MariaDB .msi + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/bin/Release/mariadb.msi + asset_name: mariadb-${{ env.MARIADB_VERSION }}-winx64.msi + asset_content_type: application/octet-stream + - name: Upload Installer .exe uses: actions/upload-release-asset@v1 env: diff --git a/build/Version.props b/build/Version.props index a0e852bce20..84866a730ea 100644 --- a/build/Version.props +++ b/build/Version.props @@ -18,8 +18,6 @@ 6 https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.24/dotnet-hosting-6.0.24-win.exe - 10.11.5 - - https://atl.mirrors.knownhost.com/mariadb//mariadb-10.11.5/winx64-packages/mariadb-10.11.5-winx64.msi + 10.11.6 diff --git a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj index 5f7032e3e52..827b40f156f 100644 --- a/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj +++ b/build/package/winget/Tgstation.Server.Host.Service.Wix.Bundle/Tgstation.Server.Host.Service.Wix.Bundle.wixproj @@ -1,7 +1,7 @@ - ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=$(TgsMariaDBRedistUrl) + ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=https://github.com/tgstation/tgstation-server/releases/download/tgstation-server-v$(TgsCoreVersion)/mariadb-$(TgsMariaDBRedistVersion)-winx64.msi Bundle x86 tgstation-server-installer diff --git a/build/package/winget/prepare_installer_input_artifacts.ps1 b/build/package/winget/prepare_installer_input_artifacts.ps1 index b2a5c6b4d7d..8e25606a9dd 100644 --- a/build/package/winget/prepare_installer_input_artifacts.ps1 +++ b/build/package/winget/prepare_installer_input_artifacts.ps1 @@ -13,7 +13,21 @@ try [XML]$versionXML = Get-Content build/Version.props -ErrorAction Stop $redistUrl = $versionXML.Project.PropertyGroup.TgsDotnetRedistUrl - $dbRedistUrl = $versionXML.Project.PropertyGroup.TgsMariaDBRedistUrl + + $dbRedistVersion = $versionXML.Project.PropertyGroup.TgsMariaDBRedistVersion + + $dbRedistMinorVersion = $dbRedistVersion.Substring(0, $dbRedistVersion.LastIndexOf(".")) + + $ProgressPreference = 'SilentlyContinue' + try + { + $json=Invoke-RestMethod -Uri "https://downloads.mariadb.org/rest-api/mariadb/${dbRedistMinorVersion}/" + } finally { + $ProgressPreference = $previousProgressPreference + } + + $msiFile = $json.releases.$dbRedistVersion.files | Where-Object { $_.package_type -eq "MSI Package" } | Select-Object -First 1 + $dbRedistUrl = $msiFile.file_download_url mkdir artifacts $previousProgressPreference = $ProgressPreference From 23f2a30fcad362101bb0bde0aba8c17130d10467 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 12:03:42 -0500 Subject: [PATCH 4/6] Pin `yarn@1.22.19` Workaround for https://github.com/yarnpkg/yarn/issues/9011 --- build/Dockerfile | 3 --- build/Version.props | 1 + src/Tgstation.Server.Common/Tgstation.Server.Common.csproj | 2 +- src/Tgstation.Server.Host/Tgstation.Server.Host.csproj | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 8762089d0a4..decfda62817 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -19,9 +19,6 @@ RUN . $NVM_DIR/nvm.sh \ && rm -rf /var/lib/apt/lists/* \ && npm install -g npm -#You may wonder why this needs to be in a seperate step. I don't know... It just works(tm) -RUN npm install -g yarn - # Build web control panel WORKDIR /repo/build diff --git a/build/Version.props b/build/Version.props index 84866a730ea..0f6cb5b9044 100644 --- a/build/Version.props +++ b/build/Version.props @@ -19,5 +19,6 @@ https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.24/dotnet-hosting-6.0.24-win.exe 10.11.6 + 1.22.19 diff --git a/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj b/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj index f0c75819fac..07b8b364a24 100644 --- a/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj +++ b/src/Tgstation.Server.Common/Tgstation.Server.Common.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index 4d35ef12803..40e00b73a7c 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -28,13 +28,13 @@ - + - + From 6e2d8c1b0084db550ec9459eff3f3a44bd445da1 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 12:04:05 -0500 Subject: [PATCH 5/6] Add missing call to `dos2unix` in `Dockerfile` --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index decfda62817..dc1526a07c3 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -52,7 +52,7 @@ RUN dotnet restore -nowarn:MSB3202,nu1503 -p:RestoreUseSkipNonexistentTargets=fa COPY . . #run dos2unix on tgs.docker.sh so we can build without issue on windows -RUN dos2unix build/tgs.docker.sh +RUN dos2unix build/tgs.docker.sh build/RemoveUnsupportedRuntimes.sh WORKDIR /repo/src/Tgstation.Server.Host.Console RUN dotnet publish -c Release -o /app \ From 227cf94b46b44a7bb7056631f7f9f4c114ca3ed2 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Tue, 14 Nov 2023 12:06:38 -0500 Subject: [PATCH 6/6] Remove unneeded package install from `Dockerfile` --- build/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index dc1526a07c3..5c7c7bd05a8 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -16,8 +16,7 @@ RUN . $NVM_DIR/nvm.sh \ && apt-get update \ && apt-get install -y \ dos2unix \ - && rm -rf /var/lib/apt/lists/* \ - && npm install -g npm + && rm -rf /var/lib/apt/lists/* # Build web control panel WORKDIR /repo/build