Skip to content

Commit

Permalink
Merge pull request #1632 from tgstation/1147-TheChangelogBiggus
Browse files Browse the repository at this point in the history
ReleaseNotes/Changelog Overhaul + MariaDB CI Fix
  • Loading branch information
Cyberboss authored Aug 20, 2023
2 parents d42e30e + fe88394 commit 7ffcfc6
Show file tree
Hide file tree
Showing 20 changed files with 1,374 additions and 156 deletions.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ They will be amalgamated together in the end.
/:cl:

:cl: Categories
Categories are divided up in the release notes and set after the :cl: header.
Categories are used by [the release notes tool](../tools/Tgstation.Server.ReleaseNotes) to generate formatted changelists used in releases.
The default category is Core.
The current standard categories are Core, DreamMaker API, HTTP API, and Host Watchdog.
Only one category may be specified for a :cl: block.
Valid categories are Core, DreamMaker API, HTTP API, Host Watchdog, Web Control Panel, Configuration, Nuget: Api, Nuget: Client, and Nuget: Common.
/:cl:

[Why]: # (If this does not close or work on an existing GitHub issue, please add a short description [two lines down] of why you think these changes would benefit the server. If you can't justify it in words, it might not be worth adding.)
32 changes: 32 additions & 0 deletions .github/workflows/check-pr-has-milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Check PR Has Milestone"

on:
pull_request:
types: [ opened, edited, synchronize, reopened ]
branches:
- dev
- master
- V6

concurrency:
group: "check-pr-milestone-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true

jobs:
fail-on-bad-milestone:
name: Fail if Pull Request has no Associated Version Milestone
runs-on: ubuntu-latest
steps:
- name: Fail if no Milestone Set
if: github.event.pull_request.milestone == null
run: |
echo "::error::Pull request must have milestone set!"
exit 1
- name: Fail if Invalid Milestone Set
run: |
if [[ ${{ github.event.pull_request.milestone.title }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
exit 0
fi
echo "::error::Pull request has non-standard milestone!"
exit 1
124 changes: 105 additions & 19 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,17 @@ jobs:
fi
exit $retval
dox-build:
name: Build Doxygen Site
pages-build:
name: Build gh-pages
runs-on: ubuntu-latest
needs: start-ci-run-gate
if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout (Branch)
uses: actions/checkout@v3
if: github.event_name == 'push' || github.event_name == 'schedule'
Expand All @@ -179,6 +184,22 @@ jobs:
with:
ref: "refs/pull/${{ github.event.number }}/merge"

- name: gh-pages Clone
run: git clone -b gh-pages --single-branch "https://git@github.com/tgstation/tgstation-server" $HOME/tgsdox

- name: Restore
run: dotnet restore

- name: Build ReleaseNotes
run: |
export TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Build Changelog (Incremental)
run: |
cp $HOME/tgsdox/changelog.yml ./ 2>/dev/null
dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --generate-full-notes
- name: Patch Doxyfile
run: |
VERSION=$(cat "build/Version.props" | grep -oPm1 "(?<=<TgsCoreVersion>)[^<]+")
Expand All @@ -189,13 +210,13 @@ jobs:
with:
doxyfile-path: 'docs/Doxyfile'

- name: gh-pages push
- name: gh-pages Push
if: github.event_name == 'push' && github.event.ref == 'refs/heads/dev' && env.TGS_RELEASE_NOTES_TOKEN != ''
run: |
git clone -b gh-pages --single-branch "https://git@github.com/tgstation/tgstation-server" $HOME/tgsdox
pushd $HOME/tgsdox
rm -r *
popd
sudo mv changlog.yml $HOME/tgsdox/
echo ./doxout/* | xargs -n 10 sudo mv -t $HOME/tgsdox
cd $HOME/tgsdox
git config --global push.default simple
Expand Down Expand Up @@ -994,9 +1015,12 @@ jobs:
run: |
echo "TGS_VERSION=$(xmlstarlet sel -N X="http://schemas.microsoft.com/developer/msbuild/2003" --template --value-of /X:Project/X:PropertyGroup/X:TgsCoreVersion build/Version.props)" >> $GITHUB_ENV
- name: Grab Most Recent Changelog
run: curl -L https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml -o changelog.yml

- name: Execute Build Script (Unsigned)
if: (!(github.event_name == 'push' && contains(github.event.head_commit.message, '[TGSDeploy]') && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/dev')))
run: sudo build/package/deb/build_package.sh
run: sudo -E build/package/deb/build_package.sh

- name: Execute Build Script (Signed)
if: (github.event_name == 'push' && contains(github.event.head_commit.message, '[TGSDeploy]') && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/dev'))
Expand Down Expand Up @@ -1204,16 +1228,18 @@ jobs:
run: dotnet restore

- name: Build ReleaseNotes
run: dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
run: |
export TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Run ReleaseNotes Check
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --winget-template-check ${{ steps.get-sha.outputs.pr_template_sha }}

ci-completion-gate: # This job exists so there isn't a moving target for branch protections
name: CI Completion Gate
needs: [ dox-build, docker-build, build-deb, build-msi, validate-openapi-spec, upload-code-coverage, check-winget-pr-template ]
needs: [ pages-build, docker-build, build-deb, build-msi, validate-openapi-spec, upload-code-coverage, check-winget-pr-template ]
runs-on: ubuntu-latest
if: (!(cancelled() || failure()) && needs.dox-build.result == 'success' && needs.docker-build.result == 'success' && needs.build-deb.result == 'success' && needs.build-msi.result == 'success' && needs.validate-openapi-spec.result == 'success' && needs.upload-code-coverage.result == 'success' && needs.check-winget-pr-template.result == 'success')
if: (!(cancelled() || failure()) && needs.pages-build.result == 'success' && needs.docker-build.result == 'success' && needs.build-deb.result == 'success' && needs.build-msi.result == 'success' && needs.validate-openapi-spec.result == 'success' && needs.upload-code-coverage.result == 'success' && needs.check-winget-pr-template.result == 'success')
steps:
- name: GitHub Requires at Least One Step for a Job
run: exit 0
Expand All @@ -1233,9 +1259,22 @@ jobs:
runs-on: windows-latest
if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && contains(github.event.head_commit.message, '[APIDeploy]'))
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout
uses: actions/checkout@v3

- name: Restore
run: dotnet restore

- name: Build ReleaseNotes
run: |
$Env:TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Parse API version
shell: powershell
run: |
Expand All @@ -1249,15 +1288,24 @@ jobs:
name: openapi-spec
path: swagger

- name: Grab Most Recent Changelog
shell: powershell
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml -OutFile changelog.yml
- name: Generate Release Notes
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes ${{ env.TGS_API_VERSION }} --httpapi

- name: Create GitHub Release
uses: juitnow/github-action-create-release@80dc88a9d09c0ee394a4a31b0450e8cbe62996ef # v1
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
with:
tag_name: api-v${{ env.TGS_API_VERSION }}
release_name: tgstation-server API v${{ env.TGS_API_VERSION }}
body: The TGS HTTP API
body_path: release_notes.md
commitish: ${{ github.event.head_commit.id }}

- name: Upload OpenApi Spec
Expand All @@ -1276,9 +1324,22 @@ jobs:
runs-on: windows-latest
if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && contains(github.event.head_commit.message, '[DMDeploy]'))
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}

- name: Checkout
uses: actions/checkout@v3

- name: Restore
run: dotnet restore

- name: Build ReleaseNotes
run: |
$Env:TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Parse DMAPI version
shell: powershell
run: |
Expand All @@ -1291,15 +1352,24 @@ jobs:
run: |
&"C:/Program Files/7-Zip/7z.exe" a DMAPI.zip ./src/DMAPI/* -tzip
- name: Grab Most Recent Changelog
shell: powershell
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml -OutFile changelog.yml
- name: Generate Release Notes
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes ${{ env.TGS_DM_VERSION }} --dmapi

- name: Create GitHub Release
uses: juitnow/github-action-create-release@v1
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
with:
tag_name: dmapi-v${{ env.TGS_DM_VERSION }}
release_name: tgstation-server DMAPI v${{ env.TGS_DM_VERSION }}
body: The TGS DMAPI \#tgs-dmapi-release
body_path: release_notes.md
commitish: ${{ github.event.head_commit.id }}

- name: Upload DMAPI Artifact
Expand All @@ -1326,6 +1396,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Restore
run: dotnet restore

- name: Build ReleaseNotes
run: |
export TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Grab Most Recent Changelog
run: curl -L https://raw.githubusercontent.com/tgstation/tgstation-server/gh-pages/changelog.yml -o changelog.yml

- name: Generate Release Notes
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes ${{ env.TGS_DM_VERSION }} --nuget

- name: Publish Tgstation.Server.Common to NuGet
uses: alirezanet/publish-nuget@e276c40afeb2a154046f0997820f2a9ea74832d9 # v3.1.0
with:
Expand Down Expand Up @@ -1368,7 +1452,9 @@ jobs:
run: dotnet restore

- name: Build ReleaseNotes
run: dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
run: |
export TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
- name: Run ReleaseNotes with --ensure-release
run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --ensure-release
Expand All @@ -1395,19 +1481,17 @@ jobs:
cd build/package/winget
dotnet tool restore
- name: Build ReleaseNotes
run: dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj

# We need to rebuild the installer.exe so it can be properly signed
- name: Restore
run: dotnet restore

- name: Build Host
run: dotnet build -c Release src/Tgstation.Server.Host/Tgstation.Server.Host.csproj

- name: Build Service
run: dotnet build -c Release src/Tgstation.Server.Host.Service/Tgstation.Server.Host.Service.csproj

- name: Build ReleaseNotes
run: dotnet build -c Release tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj

- name: Prepare Artifacts
shell: powershell
run: build/package/winget/prepare_installer_input_artifacts.ps1
Expand Down Expand Up @@ -1634,7 +1718,9 @@ jobs:
uses: actions/checkout@v3

- name: Build ReleaseNotes
run: dotnet build -c Release tools/Tgstation.Server.ReleaseNotes
run: |
$Env:TGS_HOST_NO_WEBPANEL=true
dotnet build -c Release tools/Tgstation.Server.ReleaseNotes
- name: Execute Push Script
shell: powershell
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ artifacts/
/tools/Tgstation.Server.ReleaseNotes/release_notes.md
launchSettings.json
release_notes.md
changelog.yml
*nupkg
*.sqlite3
packaging/
4 changes: 2 additions & 2 deletions build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<TgsNetMajorVersion>6</TgsNetMajorVersion>
<!-- Update this frequently with dotnet runtime patches. MAJOR MUST MATCH ABOVE! -->
<TgsDotnetRedistUrl>https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.21/dotnet-hosting-6.0.21-win.exe</TgsDotnetRedistUrl>
<TgsMariaDBRedistVersion>11.0.2</TgsMariaDBRedistVersion>
<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://ftp.osuosl.org/pub/mariadb/mariadb-11.0.2/winx64-packages/mariadb-11.0.2-winx64.msi</TgsMariaDBRedistUrl>
<TgsMariaDBRedistUrl>https://ftp.osuosl.org/pub/mariadb//mariadb-10.11.5/winx64-packages/mariadb-10.11.5-winx64.msi</TgsMariaDBRedistUrl>
</PropertyGroup>
</Project>
7 changes: 6 additions & 1 deletion build/package/deb/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ dh_make -p tgstation-server_$TGS_VERSION -y --createorig -s

rm -f debian/README* debian/changelog debian/*.ex debian/upstream/*.ex

pushd ..
export TGS_HOST_NO_WEBPANEL=true
dotnet run -c Release --project tools/Tgstation.Server.ReleaseNotes $TGS_VERSION --debian packaging/debian/changelog $CURRENT_COMMIT
export TGS_HOST_NO_WEBPANEL=false
popd

cp -r build/package/deb/debian/* debian/
sed -i "s/~!VERSION!~/$TGS_VERSION/g" debian/changelog

cp build/tgstation-server.service debian/

Expand Down
5 changes: 0 additions & 5 deletions build/package/deb/debian/changelog

This file was deleted.

2 changes: 1 addition & 1 deletion src/Tgstation.Server.Api/Tgstation.Server.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Version>$(TgsApiLibraryVersion)</Version>
<Description>API definitions for tgstation-server.</Description>
<PackageTags>json web api tgstation-server tgstation ss13 byond http</PackageTags>
<PackageReleaseNotes>Added support for -map-threads DreamDaemon parameter and UploadZip Administration update option.</PackageReleaseNotes>
<PackageReleaseNotes>$(TGS_NUGET_RELEASE_NOTES_API)</PackageReleaseNotes>
<NoWarn>CA1028</NoWarn>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Version>$(TgsClientVersion)</Version>
<Description>Client library for tgstation-server.</Description>
<PackageTags>json web api tgstation-server tgstation ss13 byond client http</PackageTags>
<PackageReleaseNotes>Added support for .zip uploads for server updates. Added missing Dispose() call to the StringContents for requests with bodies and added missing ConfigureAwait(false) to async call.</PackageReleaseNotes>
<PackageReleaseNotes>$(TGS_NUGET_RELEASE_NOTES_CLIENT)</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Tgstation.Server.Common/Tgstation.Server.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Version>$(TgsCommonLibraryVersion)</Version>
<Description>Common functions for tgstation-server.</Description>
<PackageTags>web tgstation-server tgstation ss13 byond client http</PackageTags>
<PackageReleaseNotes>Added CachedResponseStream.</PackageReleaseNotes>
<PackageReleaseNotes>$(TGS_NUGET_RELEASE_NOTES_COMMON)</PackageReleaseNotes>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ public sealed class ControlPanelConfiguration
/// <summary>
/// If the control panel is enabled.
/// </summary>
public bool Enable { get; set; }
public bool Enable
#if NO_WEBPANEL
{
get => false;
set => _ = value;
}
#else
{
get;
set;
}
#endif

/// <summary>
/// If any origin is allowed for CORS requests. This overrides <see cref="AllowedOrigins"/>.
Expand Down
Loading

0 comments on commit 7ffcfc6

Please sign in to comment.