diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index abd39d5456..867323f977 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -424,6 +424,8 @@ jobs: 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: - name: Checkout (Branch) uses: actions/checkout@v4 @@ -435,8 +437,16 @@ jobs: with: ref: "refs/pull/${{ github.event.number }}/merge" + - name: Setup Telemetry Key File + shell: bash + run: echo "${{ secrets.TGS_TELEMETRY_KEY }}" > ${{ env.TGS_TELEMETRY_KEY_FILE }} + - name: Build Docker Image - run: docker build . -f build/Dockerfile + run: docker build . -f build/Dockerfile --build-arg TGS_TELEMETRY_KEY_FILE=${{ env.TGS_TELEMETRY_KEY_FILE }} + + - name: Delete Telemetry Key File + if: always() + run: rm ${{ env.TGS_TELEMETRY_KEY_FILE }} linux-unit-tests: name: Linux Tests diff --git a/build/Dockerfile b/build/Dockerfile index cba330156e..6309cec618 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,5 +1,8 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build +# Set in CI +ARG TGS_TELEMETRY_KEY_FILE= + # install node and npm # replace shell with bash so we can source files RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | sh @@ -17,7 +20,8 @@ RUN . $NVM_DIR/nvm.sh \ && apt-get install -y \ dos2unix \ libgdiplus \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ + && corepack enable # Build web control panel WORKDIR /repo/build @@ -45,7 +49,9 @@ RUN dotnet publish -c Release -o /app \ && build/RemoveUnsupportedRuntimes.sh /app WORKDIR /repo/src/Tgstation.Server.Host -RUN dotnet publish -c Release -o /app/lib/Default \ + +RUN export TGS_TELEMETRY_KEY_FILE="${TGS_TELEMETRY_KEY_FILE}" \ + && dotnet publish -c Release -o /app/lib/Default \ && cd ../.. \ && build/RemoveUnsupportedRuntimes.sh /app/lib/Default \ && mv /app/lib/Default/appsettings* /app diff --git a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj index 48025ddd9b..0a3a5a3a06 100644 --- a/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj +++ b/src/Tgstation.Server.Host/Tgstation.Server.Host.csproj @@ -60,6 +60,7 @@ +