-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.38 KB
/
tgs_deployments_telemetry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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