diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml
index cd13a5c532..822e137cc6 100644
--- a/.github/workflows/ci-pipeline.yml
+++ b/.github/workflows/ci-pipeline.yml
@@ -29,11 +29,11 @@ on:
branches:
- dev
- master
- pull_request_target:
- types: [ opened, reopened, labeled, synchronize ]
- branches:
- - dev
- - master
+ workflow_dispatch:
+ inputs:
+ pull_request_number:
+ description: 'Pull Request Number'
+ required: true
env:
TGS_DOTNET_VERSION: 8
@@ -47,71 +47,18 @@ env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
concurrency:
- group: "ci-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
+ group: "ci-${{ github.head_ref || (github.event_name != 'push' && github.event_name != 'schedule' && github.event.inputs.pull_request_number) || github.run_id }}-${{ github.event_name }}"
cancel-in-progress: true
jobs:
- security-checkpoint:
- name: Check CI Clearance
- runs-on: ubuntu-latest
- permissions:
- pull-requests: write
- if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open'
- steps:
- - name: Comment on new Fork PR
- if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id != 49699333
- uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308
- with:
- message: Thank you for contributing to ${{ github.event.pull_request.base.repo.name }}! The workflow '${{ github.workflow }}' requires repository secrets and will not run without approval. Maintainers can add the `CI Cleared` label to allow it to run. Please note that any changes to the workflow file will not be reflected in the run.
-
- - name: Comment on dependabot PR
- if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id == 49699333
- uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308
- with:
- message: Set the milestone to the next minor version, check for supply chain attacks, and then add the `CI Cleared` label to allow CI to run.
-
- - name: "Remove Stale 'CI Cleared' Label"
- if: github.event.action == 'synchronize' || github.event.action == 'reopened'
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
- with:
- labels: CI Cleared
-
- - name: "Remove 'CI Approval Required' Label"
- if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
- with:
- labels: CI Approval Required
-
- - name: "Add 'CI Approval Required' Label"
- if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
- uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
- with:
- labels: CI Approval Required
- github_token: ${{ github.token }}
-
- - name: Fail Clearance Check if PR has Unlabeled new Commits from User
- if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
- run: exit 1
-
- start-ci-run-gate:
- name: CI Start Gate
- needs: security-checkpoint
- runs-on: ubuntu-latest
- if: (!(cancelled() || failure()) && (needs.security-checkpoint.result == 'success' || (needs.security-checkpoint.result == 'skipped' && (github.event_name == 'push' || github.event_name == 'schedule' || ((github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id && github.event.pull_request.user.id != 49699333) && github.event_name != 'pull_request_target')))))
- steps:
- - name: GitHub Requires at Least One Step for a Job
- run: exit 0
-
code-scanning:
name: Code Scanning
- needs: start-ci-run-gate
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
env:
TGS_TELEMETRY_KEY_FILE: /tmp/tgs_telemetry_key.txt
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -127,7 +74,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
@@ -151,8 +98,6 @@ jobs:
dmapi-build:
name: Build DMAPI
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
strategy:
fail-fast: false
matrix:
@@ -210,7 +155,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Build DMAPI Test Project
run: |
@@ -234,8 +179,6 @@ jobs:
opendream-build:
name: Build DMAPI (OpenDream)
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
strategy:
fail-fast: false
matrix:
@@ -264,7 +207,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Checkout OpenDream
run: |
@@ -297,8 +240,6 @@ jobs:
efcore-version-match:
name: Check Nuget Versions Match Tools
runs-on: ubuntu-latest
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
steps:
- name: Checkout (Branch)
uses: actions/checkout@v4
@@ -308,7 +249,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Retrieve dotnet-ef Tool Version
id: dotnet-ef-tool
@@ -355,8 +296,6 @@ jobs:
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@v4
@@ -372,7 +311,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -431,8 +370,6 @@ jobs:
docker-build:
name: Build Docker Image
runs-on: ubuntu-latest
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
env:
TGS_TELEMETRY_KEY_FILE: tgs_telemetry_key.txt
steps:
@@ -444,7 +381,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Setup Telemetry Key File
shell: bash
@@ -459,8 +396,6 @@ jobs:
linux-unit-tests:
name: Linux Tests
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
strategy:
fail-fast: false
matrix:
@@ -496,7 +431,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -532,8 +467,6 @@ jobs:
windows-unit-tests:
name: Windows Tests
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
strategy:
fail-fast: false
matrix:
@@ -563,7 +496,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -602,7 +535,6 @@ jobs:
windows-integration-test:
name: Windows Live Tests
needs: [dmapi-build, opendream-build]
- if: (!(cancelled() || failure()) && needs.dmapi-build.result == 'success' && needs.opendream-build.result == 'success')
strategy:
fail-fast: false
matrix:
@@ -698,7 +630,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -811,7 +743,6 @@ jobs:
linux-integration-tests:
name: Linux Live Tests
needs: [dmapi-build, opendream-build]
- if: (!(cancelled() || failure()) && needs.dmapi-build.result == 'success' && needs.opendream-build.result == 'success')
services: # We start all dbs here so we can just code the stuff once
mssql:
image: ${{ (matrix.database-type == 'SqlServer') && 'mcr.microsoft.com/mssql/server:2019-latest' || '' }}
@@ -923,7 +854,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -998,7 +929,6 @@ jobs:
validate-openapi-spec:
name: OpenAPI Spec Validation
needs: windows-integration-test
- if: (!(cancelled() || failure()) && needs.windows-integration-test.result == 'success')
runs-on: ubuntu-latest
steps:
- name: Install IBM OpenAPI Validator
@@ -1012,7 +942,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Retrieve OpenAPI Spec
uses: actions/download-artifact@v4
@@ -1026,7 +956,6 @@ jobs:
upload-code-coverage:
name: Upload Code Coverage
needs: [linux-unit-tests, linux-integration-tests, windows-unit-tests, windows-integration-test]
- if: (!(cancelled() || failure()) && needs.linux-unit-tests.result == 'success' && needs.linux-integration-tests.result == 'success' && needs.windows-unit-tests.result == 'success' && needs.windows-integration-test.result == 'success')
runs-on: ubuntu-latest
steps:
- name: Checkout (Branch)
@@ -1037,7 +966,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Retrieve Linux Unit Test Coverage (Debug)
uses: actions/download-artifact@v4
@@ -1281,9 +1210,7 @@ jobs:
build-deb:
name: Build .deb Package # Can't do i386 due to https://github.com/dotnet/core/issues/4595
- needs: start-ci-run-gate
runs-on: ubuntu-latest
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
env:
TGS_TELEMETRY_KEY_FILE: /tmp/tgs_telemetry_key.txt
steps:
@@ -1327,7 +1254,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Parse TGS version
run: |
@@ -1394,9 +1321,7 @@ jobs:
build-msi:
name: Build Windows Installer .exe
- needs: start-ci-run-gate
runs-on: windows-latest
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
steps:
@@ -1424,7 +1349,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore Wix dotnet Tool
run: |
@@ -1544,8 +1469,6 @@ jobs:
check-winget-pr-template:
name: Check winget-pkgs Pull Request Template is up to date
- needs: start-ci-run-gate
- if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
runs-on: ubuntu-latest
steps:
- name: Setup dotnet
@@ -1568,7 +1491,7 @@ jobs:
uses: actions/checkout@v4
if: github.event_name != 'push' && github.event_name != 'schedule'
with:
- ref: "refs/pull/${{ github.event.number }}/merge"
+ ref: "refs/pull/${{ github.event_name == 'pull_request' && github.event.number || github.event.inputs.pull_request_number }}/merge"
- name: Restore
run: dotnet restore
@@ -1583,43 +1506,15 @@ jobs:
name: CI Completion Gate
needs: [ pages-build, docker-build, build-deb, build-msi, validate-openapi-spec, upload-code-coverage, check-winget-pr-template, code-scanning, efcore-version-match ]
runs-on: ubuntu-latest
- 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' && needs.code-scanning.result == 'success')
steps:
- - name: Setup dotnet
- uses: actions/setup-dotnet@v4
- with:
- dotnet-version: '${{ env.TGS_DOTNET_VERSION }}.0.x'
- dotnet-quality: ${{ env.TGS_DOTNET_QUALITY }}
-
- - name: Checkout (Branch)
- uses: actions/checkout@v4
- if: github.event_name == 'push' || github.event_name == 'schedule'
-
- - name: Checkout (PR Merge)
- uses: actions/checkout@v4
- if: github.event_name != 'push' && github.event_name != 'schedule'
- with:
- ref: "refs/pull/${{ github.event.number }}/merge"
-
- - name: Restore
- run: dotnet restore
-
- - name: Build ReleaseNotes
- run: dotnet build -c Release -p:TGS_HOST_NO_WEBPANEL=true tools/Tgstation.Server.ReleaseNotes/Tgstation.Server.ReleaseNotes.csproj
-
- - name: Run ReleaseNotes Create CI Completion Check (PR HEAD)
- if: github.event_name != 'push' && github.event_name != 'schedule'
- run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --ci-completion-check ${{ github.event.pull_request.head.sha }} ${{ secrets.TGS_CI_GITHUB_APP_TOKEN_BASE64 }}
-
- - name: Run ReleaseNotes Create CI Completion Check (Branch)
- if: github.event_name == 'push' || github.event_name == 'schedule'
- run: dotnet run -c Release --no-build --project tools/Tgstation.Server.ReleaseNotes --ci-completion-check ${{ github.sha }} ${{ secrets.TGS_CI_GITHUB_APP_TOKEN_BASE64 }}
+ - name: GitHub Requires at Least One Step for a Job
+ run: exit 0
deployment-gate:
name: Deployment Start Gate
needs: ci-completion-gate
runs-on: ubuntu-latest
- if: (!(cancelled() || failure()) && needs.ci-completion-gate.result == 'success' && github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/dev'))
+ if: github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/dev')
steps:
- name: GitHub Requires at Least One Step for a Job
run: exit 0
@@ -1628,7 +1523,7 @@ jobs:
name: Deploy HTTP API
needs: deployment-gate
runs-on: windows-latest
- if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && contains(github.event.head_commit.message, '[APIDeploy]'))
+ if: contains(github.event.head_commit.message, '[APIDeploy]')
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1700,7 +1595,7 @@ jobs:
name: Deploy DreamMaker API
needs: deployment-gate
runs-on: windows-latest
- if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && contains(github.event.head_commit.message, '[DMDeploy]'))
+ if: contains(github.event.head_commit.message, '[DMDeploy]')
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1771,7 +1666,7 @@ jobs:
name: Deploy Nuget Packages
needs: deployment-gate
runs-on: ubuntu-latest
- if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && contains(github.event.head_commit.message, '[NugetDeploy]'))
+ if: contains(github.event.head_commit.message, '[NugetDeploy]')
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1822,7 +1717,7 @@ jobs:
name: Ensure TGS Release is Latest GitHub Release
needs: [deploy-dm, deploy-http]
runs-on: ubuntu-latest
- if: (!(cancelled() || failure()) && (needs.deploy-dm.result == 'success' || needs.deploy-http.result == 'success') && !contains(github.event.head_commit.message, '[TGSDeploy]'))
+ if: (!contains(github.event.head_commit.message, '[TGSDeploy]'))
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@@ -1846,7 +1741,7 @@ jobs:
name: Deploy TGS
needs: [deploy-dm, deploy-http, deployment-gate]
runs-on: windows-latest
- if: (!(cancelled() || failure()) && needs.deployment-gate.result == 'success' && github.event.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[TGSDeploy]'))
+ if: github.event.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[TGSDeploy]')
env:
TGS_TELEMETRY_KEY_FILE: C:/tgs_telemetry_key.txt
steps:
@@ -1872,8 +1767,6 @@ jobs:
cd build/package/winget
dotnet tool restore
- # We need to rebuild the installer.exe so it can be properly signed
-
- name: Enable Corepack
run: corepack enable
@@ -1881,7 +1774,7 @@ jobs:
shell: bash
run: echo "${{ secrets.TGS_TELEMETRY_KEY }}" > ${{ env.TGS_TELEMETRY_KEY_FILE }}
- - name: Build Host
+ - name: Build Host # We need to rebuild the installer.exe so it can be properly signed
run: dotnet build -c Release src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
- name: Delete Telemetry Key File
diff --git a/.github/workflows/ci-security.yml b/.github/workflows/ci-security.yml
new file mode 100644
index 0000000000..3a860fb5a9
--- /dev/null
+++ b/.github/workflows/ci-security.yml
@@ -0,0 +1,70 @@
+name: 'CI Security'
+
+on:
+ pull_request_target:
+ types: [ opened, reopened, labeled, synchronize ]
+ branches:
+ - dev
+ - master
+
+concurrency:
+ group: "ci-security-${{ github.head_ref || github.run_id }}-${{ github.event_name }}"
+ cancel-in-progress: true
+
+jobs:
+ security-checkpoint:
+ name: Check CI Clearance
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ actions: write
+ if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open'
+ steps:
+ - name: Comment on new Fork PR
+ if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id != 49699333
+ uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308
+ with:
+ message: Thank you for contributing to ${{ github.event.pull_request.base.repo.name }}! The workflow '${{ github.workflow }}' requires repository secrets and will not run without approval. Maintainers can add the `CI Cleared` label to allow it to run. Please note that any changes to the workflow file will not be reflected in the run.
+
+ - name: Comment on dependabot PR
+ if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'CI Cleared') && github.event.pull_request.user.id == 49699333
+ uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308
+ with:
+ message: Set the milestone to the next minor version, check for supply chain attacks, and then add the `CI Cleared` label to allow CI to run.
+
+ - name: "Remove Stale 'CI Cleared' Label"
+ if: github.event.action == 'synchronize' || github.event.action == 'reopened'
+ uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
+ with:
+ labels: CI Cleared
+
+ - name: "Remove 'CI Approval Required' Label"
+ if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
+ uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
+ with:
+ labels: CI Approval Required
+
+ - name: "Add 'CI Approval Required' Label"
+ if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
+ uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
+ with:
+ labels: CI Approval Required
+ github_token: ${{ github.token }}
+
+ - name: Fail if PR has Unlabeled new Commits from User
+ if: (github.event.action == 'synchronize' || github.event.action == 'reopened') || ((github.event.action == 'opened' || github.event.action == 'labeled') && !contains(github.event.pull_request.labels.*.name, 'CI Cleared'))
+ run: exit 1
+
+ - name: Dispatch CI Pipeline Workflow
+ uses: lasith-kg/dispatch-workflow@5623bf13f09bbbbdb549ec692b070307f39b66ac #v2.0.0 + setup_node@v4
+ with:
+ dispatch-method: workflow_dispatch
+ owner: ${{ github.repository_owner }}
+ repo: ${{ github.event.pull_request.base.repo.name }}
+ ref: ${{ github.event.pull_request.base.ref }}
+ workflow: ci-pipeline.yml
+ token: ${{ github.token }}
+ workflow-inputs: |
+ {
+ "pull_request_number": "${{ github.event.pull_request.number }}"
+ }
diff --git a/build/TestCommon.props b/build/TestCommon.props
index 98703bdbfd..79449e89df 100644
--- a/build/TestCommon.props
+++ b/build/TestCommon.props
@@ -18,9 +18,9 @@
-
+
-
+
diff --git a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
index 89c048c68f..fdb60b80d8 100644
--- a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
+++ b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Tgstation.Server.Host/.config/dotnet-tools.json b/src/Tgstation.Server.Host/.config/dotnet-tools.json
index af52642792..a3847dcdfb 100644
--- a/src/Tgstation.Server.Host/.config/dotnet-tools.json
+++ b/src/Tgstation.Server.Host/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
- "version": "8.0.7",
+ "version": "8.0.8",
"commands": [
"dotnet-ef"
]
diff --git a/src/Tgstation.Server.Host/Controllers/RootController.cs b/src/Tgstation.Server.Host/Controllers/RootController.cs
index df363970bb..577fecf1c6 100644
--- a/src/Tgstation.Server.Host/Controllers/RootController.cs
+++ b/src/Tgstation.Server.Host/Controllers/RootController.cs
@@ -152,11 +152,17 @@ namespace Tgstation.Server.Host.Controllers
[HttpGet("logo.svg")]
public IActionResult GetLogo()
{
- var logoFileName = platformIdentifier.IsWindows // these are different because of motherfucking line endings -_-
- ? LogoSvgWindowsName
- : LogoSvgLinuxName;
+ // these are different because of motherfucking line endings -_-
+ if (platformIdentifier.IsWindows)
+ {
+ VirtualFileResult? result = this.TryServeFile(hostEnvironment, logger, $"{LogoSvgWindowsName}.svg");
+ if (result != null)
+ return result;
- return (IActionResult?)this.TryServeFile(hostEnvironment, logger, $"{logoFileName}.svg") ?? NotFound();
+ // BUT THE UPDATE PACKAGES ARE BUILT ON LINUX RAAAAAGH
+ }
+
+ return (IActionResult?)this.TryServeFile(hostEnvironment, logger, $"{LogoSvgLinuxName}.svg") ?? NotFound();
}
///
diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
index 0a3a5a3a06..9a78cc7627 100644
--- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
+++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj
@@ -100,13 +100,13 @@
-
+
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -114,7 +114,7 @@
-
+
diff --git a/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj b/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
index 01518a39b0..c092a103f7 100644
--- a/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
+++ b/src/Tgstation.Server.Shared/Tgstation.Server.Shared.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/tools/Tgstation.Server.ReleaseNotes/Program.cs b/tools/Tgstation.Server.ReleaseNotes/Program.cs
index d9f5981df8..b5841dfd03 100644
--- a/tools/Tgstation.Server.ReleaseNotes/Program.cs
+++ b/tools/Tgstation.Server.ReleaseNotes/Program.cs
@@ -60,7 +60,6 @@ namespace Tgstation.Server.ReleaseNotes
var shaCheck = versionString.Equals("--winget-template-check", StringComparison.OrdinalIgnoreCase);
var fullNotes = versionString.Equals("--generate-full-notes", StringComparison.OrdinalIgnoreCase);
var nuget = versionString.Equals("--nuget", StringComparison.OrdinalIgnoreCase);
- var ciCompletionCheck = versionString.Equals("--ci-completion-check", StringComparison.OrdinalIgnoreCase);
var genToken = versionString.Equals("--token-output-file", StringComparison.OrdinalIgnoreCase);
if ((!Version.TryParse(versionString, out var version) || version.Revision != -1)
@@ -69,7 +68,6 @@ namespace Tgstation.Server.ReleaseNotes
&& !shaCheck
&& !fullNotes
&& !nuget
- && !ciCompletionCheck
&& !genToken)
{
Console.WriteLine("Invalid version: " + versionString);
@@ -151,17 +149,6 @@ namespace Tgstation.Server.ReleaseNotes
return await Winget(client, actionsUrl, null);
}
- if (ciCompletionCheck)
- {
- if (args.Length < 3)
- {
- Console.WriteLine("Missing SHA or PEM Base64 for creating check run!");
- return 4543;
- }
-
- return await CICompletionCheck(client, args[1], args[2]);
- }
-
if (genToken)
{
@@ -1676,21 +1663,6 @@ package (version) distribution(s); urgency=urgency
gitHubClient.Credentials = new Credentials(installToken.Token);
}
- static async ValueTask CICompletionCheck(GitHubClient gitHubClient, string currentSha, string pemBase64)
- {
- await GenerateAppCredentials(gitHubClient, pemBase64, false);
-
- await gitHubClient.Check.Run.Create(RepoOwner, RepoName, new NewCheckRun("CI Completion", currentSha)
- {
- CompletedAt = DateTime.UtcNow,
- Conclusion = CheckConclusion.Success,
- Output = new NewCheckRunOutput("CI Completion", "The CI Pipeline completed successfully"),
- Status = CheckStatus.Completed,
- });
-
- return 0;
- }
-
static void DebugAssert(bool condition, string message = null)
{
// This exists because one of the fucking asserts evaluates an enumerable or something and it was getting optimized out in release