From a0dff80c35f19ff135593aee1f3de16ece4a08d7 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 28 Aug 2024 18:02:46 -0400 Subject: [PATCH 1/4] Fix version reporting when the user directory for TGS was not created beforehand --- src/Tgstation.Server.Host/Core/VersionReportingService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Core/VersionReportingService.cs b/src/Tgstation.Server.Host/Core/VersionReportingService.cs index dd0eef6f78..6ed4b2812f 100644 --- a/src/Tgstation.Server.Host/Core/VersionReportingService.cs +++ b/src/Tgstation.Server.Host/Core/VersionReportingService.cs @@ -119,15 +119,17 @@ namespace Tgstation.Server.Host.Core try { + var telemetryIdDirectory = ioManager.GetPathInLocalDirectory(assemblyInformationProvider); var telemetryIdFile = ioManager.ResolvePath( ioManager.ConcatPath( - ioManager.GetPathInLocalDirectory(assemblyInformationProvider), + telemetryIdDirectory, "telemetry.id")); Guid telemetryId; if (!await ioManager.FileExists(telemetryIdFile, stoppingToken)) { telemetryId = Guid.NewGuid(); + await ioManager.CreateDirectory(telemetryIdDirectory, stoppingToken); await ioManager.WriteAllBytes(telemetryIdFile, Encoding.UTF8.GetBytes(telemetryId.ToString()), stoppingToken); logger.LogInformation("Generated telemetry ID {telemetryId} and wrote to {file}", telemetryId, telemetryIdFile); } From a7c1b030e907fade2c14f2e4511a1c7103d95600 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 28 Aug 2024 18:03:12 -0400 Subject: [PATCH 2/4] Version bump to 6.9.2 --- build/Version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Version.props b/build/Version.props index fe1a952886..af7c24e51a 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,7 +3,7 @@ - 6.9.1 + 6.9.2 5.2.0 10.7.0 7.0.0 From 087074ce7b64ae8bc25030cfae50be65283ce597 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 28 Aug 2024 18:31:51 -0400 Subject: [PATCH 3/4] Scope the SS13 org token --- .github/workflows/update-ss13-org-mirror.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-ss13-org-mirror.yml b/.github/workflows/update-ss13-org-mirror.yml index b3e128e51d..e7e2123a05 100644 --- a/.github/workflows/update-ss13-org-mirror.yml +++ b/.github/workflows/update-ss13-org-mirror.yml @@ -22,6 +22,7 @@ jobs: uses: actions/create-github-app-token@v1 with: owner: spacestation13 + repositories: tgstation-server app-id: ${{ secrets.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} From 0c0372dcabe20e721d3ea15f03fe7540d2455841 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 28 Aug 2024 18:37:56 -0400 Subject: [PATCH 4/4] Use app token for ppa push --- .github/workflows/ci-pipeline.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index bcbac82895..1408000966 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -2156,9 +2156,17 @@ jobs: - name: Parse TGS version 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: Generate App Token + id: app-token-generation + uses: actions/create-github-app-token@v1 + with: + repositories: tgstation-ppa + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Trigger tgstation-ppa workflow run: | - curl -XPOST -u "${{ vars.DEV_PUSH_USERNAME }}:${{ secrets.DEV_PUSH_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/tgstation/tgstation-ppa/actions/workflows/add_tgs_version.yml/dispatches --data '{"ref":"main","inputs":{"tgs_semver": "${{ env.TGS_VERSION }}"}}' + curl -XPOST -u "tgstation-server-ci:${{ steps.app-token-generation.outputs.token }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/tgstation/tgstation-ppa/actions/workflows/add_tgs_version.yml/dispatches --data '{"ref":"main","inputs":{"tgs_semver": "${{ env.TGS_VERSION }}"}}' deploy-winget: name: Deploy TGS (winget)