TGS Deployments Telemetry #4020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TGS Deployments Telemetry | |
on: | |
workflow_dispatch: | |
inputs: | |
telemetry_id: | |
description: "Telemetry ID" | |
required: true | |
type: string | |
tgs_semver: | |
description: "TGS Version" | |
required: true | |
type: string | |
shutdown: | |
description: "Shutdown" | |
required: true | |
type: boolean | |
server_friendly_name: | |
description: "Server Friendly Name" | |
type: string | |
jobs: | |
report_version: | |
name: Report TGS Version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Tool Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: temp_workspace | |
- name: Build | |
run: | | |
cd temp_workspace/tools/Tgstation.Server.DeploymentsTool | |
dotnet publish -c Release -o ${{ runner.temp }}/tool | |
- name: Generate App Token | |
id: app-token-generation | |
uses: actions/create-github-app-token@v1 | |
with: | |
repositories: tgstation-server,tgstation-server-deployments | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Main Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: data | |
token: ${{ steps.app-token-generation.outputs.token }} | |
fetch-depth: 0 | |
- name: Update Deployments | |
env: | |
TELEMETRY_ID: ${{ github.event.inputs.telemetry_id }} | |
TGS_SEMVER: ${{ github.event.inputs.tgs_semver }} | |
SHUTDOWN: ${{ github.event.inputs.shutdown }} | |
SERVER_FRIENDLY_NAME: ${{ github.event.inputs.server_friendly_name }} | |
run: dotnet ${{ runner.temp }}/tool/Tgstation.Server.DeploymentsTool.dll ${{ steps.app-token-generation.outputs.token }} telemetry | |
- name: Git Config | |
run: | | |
git config user.name "tgstation-server-ci[bot]" | |
git config user.email "161980869+tgstation-server-ci[bot]@users.noreply.github.com" | |
- name: Git Stage | |
run: git add . | |
- name: Git Commit | |
run: | | |
git diff-index --quiet HEAD || git commit -m 'Update Telemetry Entry' -m 'Job: ${{ github.run_id }}' | |
- name: Git Pull & Push # Pull is a shitty workaround for https://github.com/orgs/community/discussions/5435 | |
run: | | |
git pull | |
git push -u origin data |