Skip to content

Commit

Permalink
Host MariaDB ourselves
Browse files Browse the repository at this point in the history
- Locate using REST API.
- Bump to 10.11.6.
- Store in GitHub releases so older installers don't break.

Closes #1633
  • Loading branch information
Cyberboss committed Nov 14, 2023
1 parent ad4946f commit 2fba0f4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
<TgsNetMajorVersion>6</TgsNetMajorVersion>
<!-- Update this frequently with dotnet runtime patches. MAJOR MUST MATCH ABOVE! -->
<TgsDotnetRedistUrl>https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.24/dotnet-hosting-6.0.24-win.exe</TgsDotnetRedistUrl>
<TgsMariaDBRedistVersion>10.11.5</TgsMariaDBRedistVersion>
<!-- The two versions must match above, this is referenced by XML readers in scripts so we can't use an MSBuild property reference -->
<TgsMariaDBRedistUrl>https://atl.mirrors.knownhost.com/mariadb//mariadb-10.11.5/winx64-packages/mariadb-10.11.5-winx64.msi</TgsMariaDBRedistUrl>
<TgsMariaDBRedistVersion>10.11.6</TgsMariaDBRedistVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="WixToolset.Sdk/4.0.2" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Import Project="../../../Common.props" />
<PropertyGroup>
<DefineConstants>ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=$(TgsMariaDBRedistUrl)</DefineConstants>
<DefineConstants>ProductVersion=$(TgsCoreVersion);NetMajorVersion=$(TgsNetMajorVersion);DotnetRedistUrl=$(TgsDotnetRedistUrl);MariaDBRedistUrl=https://github.com/tgstation/tgstation-server/releases/download/tgstation-server-v$(TgsCoreVersion)/mariadb-$(TgsMariaDBRedistVersion)-winx64.msi</DefineConstants>
<OutputType>Bundle</OutputType>
<Platforms>x86</Platforms>
<OutputName>tgstation-server-installer</OutputName>
Expand Down
16 changes: 15 additions & 1 deletion build/package/winget/prepare_installer_input_artifacts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fba0f4

Please sign in to comment.