Skip to content

Commit

Permalink
Merge pull request #1635 from tgstation/v5140Release [TGSDeploy][Nuge…
Browse files Browse the repository at this point in the history
…tDeploy]

v5.14.0 Release. Fix gh-pages build. Unpin wingetcreate version
  • Loading branch information
Cyberboss committed Aug 21, 2023
2 parents f967fe2 + 2d02b2f commit d85987d
Show file tree
Hide file tree
Showing 74 changed files with 2,359 additions and 487 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
158 changes: 126 additions & 32 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: |
mv $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,10 +210,10 @@ 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
sudo mv changelog.yml $HOME/tgsdox/
pushd $HOME/tgsdox
rm -r *
popd
Expand Down Expand Up @@ -464,17 +485,20 @@ jobs:
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'Basic' }}
run: |
cd src/Tgstation.Server.Host.Service
dotnet publish -c ${{ matrix.configuration }} -o ../../Artifacts/Service
dotnet publish -c ${{ matrix.configuration }} -o ../../artifacts/Service
cd ../Tgstation.Server.Host
dotnet publish -c ${{ matrix.configuration }} --no-build -o ../../Artifacts/Service/lib/Default
mv ../../Artifacts/Service/lib/Default/appsettings.yml ../../Artifacts/Service/appsettings.yml
dotnet publish -c ${{ matrix.configuration }} --no-build -o ../../artifacts/Service/lib/Default
cd ../..
mv artifacts/Service/lib/Default/appsettings.yml artifacts/Service/appsettings.yml
build/RemoveUnsupportedRuntimes.sh artifacts/Service/lib/Default
build/RemoveUnsupportedServiceRuntimes.ps1 artifacts/Service
- name: Store Server Service
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'Basic' }}
uses: actions/upload-artifact@v3
with:
name: ServerService
path: Artifacts/Service/
path: artifacts/Service/

- name: Install Code Signing Certificate
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'Basic' }}
Expand All @@ -489,7 +513,7 @@ jobs:
- name: Test Sign Service .exe
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'Basic' }}
shell: powershell
run: Set-AuthenticodeSignature Artifacts/Service/Tgstation.Server.Host.Service.exe -Certificate (Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq "${{ vars.CODE_SIGNING_THUMBPRINT }}" }) -TimestampServer "http://timestamp.digicert.com"
run: Set-AuthenticodeSignature artifacts/Service/Tgstation.Server.Host.Service.exe -Certificate (Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq "${{ vars.CODE_SIGNING_THUMBPRINT }}" }) -TimestampServer "http://timestamp.digicert.com"

linux-integration-tests:
name: Linux Live Tests
Expand Down Expand Up @@ -626,31 +650,36 @@ jobs:
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'System' && matrix.database-type == 'MariaDB' }}
run: |
cd src/Tgstation.Server.Host.Console
dotnet publish -c ${{ matrix.configuration }} -o ../../Artifacts/Console
dotnet publish -c ${{ matrix.configuration }} -o ../../artifacts/Console
cd ../Tgstation.Server.Host
dotnet publish -c ${{ matrix.configuration }}NoWindows --no-build -o ../../Artifacts/Console/lib/Default
mv ../../Artifacts/Console/lib/Default/appsettings.yml ../../Artifacts/Console/appsettings.yml
dotnet publish -c ${{ matrix.configuration }}NoWindows --no-build -o ../../artifacts/Console/lib/Default
cd ../..
mv artifacts/Console/lib/Default/appsettings.yml artifacts/Console/appsettings.yml
build/RemoveUnsupportedRuntimes.sh artifacts/Console/lib/Default
build/RemoveUnsupportedRuntimes.sh artifacts/Console
- name: Package Server Update Package
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'System' && matrix.database-type == 'PostgresSql' }}
run: |
cd src/Tgstation.Server.Host
dotnet publish -c ${{ matrix.configuration }}NoWindows --no-build -o ../../Artifacts/ServerUpdate
rm ../../Artifacts/ServerUpdate/appsettings.yml
dotnet publish -c ${{ matrix.configuration }}NoWindows --no-build -o ../../artifacts/ServerUpdate
cd ../..
rm artifacts/ServerUpdate/appsettings.yml
build/RemoveUnsupportedRuntimes.sh artifacts/ServerUpdate
- name: Store Server Console
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'System' && matrix.database-type == 'MariaDB' }}
uses: actions/upload-artifact@v3
with:
name: ServerConsole
path: Artifacts/Console/
path: artifacts/Console/

- name: Store Server Update Package
if: ${{ matrix.configuration == 'Release' && matrix.watchdog-type == 'System' && matrix.database-type == 'PostgresSql' }}
uses: actions/upload-artifact@v3
with:
name: ServerUpdatePackage
path: Artifacts/ServerUpdate/
path: artifacts/ServerUpdate/

validate-openapi-spec:
name: OpenAPI Spec Validation
Expand Down Expand Up @@ -986,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 @@ -1196,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 @@ -1225,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 @@ -1241,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 @@ -1268,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 @@ -1283,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 @@ -1318,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 @@ -1360,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 @@ -1387,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 @@ -1620,13 +1712,15 @@ jobs:
GITHUB_TOKEN: ${{ env.WINGET_PUSH_TOKEN }}

- name: Install wingetcreate
run: winget install wingetcreate --version 1.2.8.0 --disable-interactivity --accept-source-agreements # Pinned due to https://github.com/microsoft/winget-create/issues/429
run: winget install wingetcreate --disable-interactivity --accept-source-agreements

- name: Checkout
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/
Loading

0 comments on commit d85987d

Please sign in to comment.