forked from cycleapple/SteamDeploy_Windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
86 lines (75 loc) · 3.62 KB
/
action.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
81
82
83
84
85
86
name: 'Steam Deploy For Windows'
author: Ming Tu <[email protected]>
description: 'Deploy game builds to Steam using the SteamSDK.'
inputs:
steamcmdPath:
required: true
default: ''
description: 'The full path for steamcmd .'
username:
required: true
default: ''
description: 'The username of your builder account.'
userpwd:
required: true
default: ''
description: 'The user password of your builder account.'
appId:
required: true
default: ''
description: 'The app id within steam partner network.'
depotId:
required: true
description: 'The depot id within steam partner network.'
rootPath:
required: true
description: 'The root path to your builds. This is the base of which depots will search your files.'
buildDescription:
required: false
description: 'Description for this build.'
releaseBranch:
required: false
description: 'The branch within steam that this build will be automatically put live on.'
runs:
using: "composite"
steps:
- name: Read Template App Build Script
shell: powershell
run: |
# Read the content of the template app build script
$templateAppScriptContent = Get-Content "${{ github.action_path }}\template\app_template.vdf"
# Replace placeholders in the template with pull request number and setlive value
$appId = ${{ inputs.appId }}
$desc = '${{ inputs.buildDescription }}'
$setLiveValue = '${{ inputs.releaseBranch }}'
$templateAppScriptContent = $templateAppScriptContent -replace '(?<="appid" ")(.*?)(?=")', $appId
$templateAppScriptContent = $templateAppScriptContent -replace '("desc" ")(.*?)(")', "`$1$desc`$3"
$templateAppScriptContent = $templateAppScriptContent -replace '("setlive" ")(.*?)(")', "`$1$setLiveValue`$3"
# Replace the depotId in the template with the provided value from the input
$depotId = ${{ inputs.depotId }}
$templateAppScriptContent = $templateAppScriptContent -replace '("")\s+"depot_build_script\.vdf"', "`"$depotId`" `"depot_build_script.vdf`""
$buildPath = '${{ inputs.rootPath }}'
$templateAppScriptContent = $templateAppScriptContent -replace '("ContentRoot" ")(.*?)(")', "`$1${buildPath}`$3"
# Write the modified content to a new app build script file
$buildAppScriptPath = "${{ github.workspace }}/app_build_script.vdf"
$templateAppScriptContent | Out-File $buildAppScriptPath -Encoding UTF8
- name: Read Template Depot Build Script
shell: powershell
run: |
# Read the content of the template depot build script
$templateDepotScriptContent = Get-Content "${{ github.action_path }}\template\depot_template.vdf"
# Replace the DepotID in the template with the provided value from the input
$depotID = ${{ inputs.depotId }}
$templateDepotScriptContent = $templateDepotScriptContent -replace '(?<="DepotID" ")(.*?)(?=")', $depotID
$buildPath = '${{ inputs.rootPath }}'
$templateDepotScriptContent = $templateDepotScriptContent -replace '("ContentRoot" ")(.*?)(")', "`$1${buildPath}`$3"
# Write the modified content to a new depot build script file
$buildDepotScriptPath = "${{ github.workspace }}/depot_build_script.vdf"
$templateDepotScriptContent | Out-File $buildDepotScriptPath -Encoding UTF8
- name: SteamDeploy
shell: cmd
run: |
${{inputs.steamcmdPath}} +login ${{inputs.username}} ${{inputs.userpwd}} +run_app_build "${{ github.workspace }}/app_build_script.vdf" +quit
branding:
icon: 'upload'
color: 'blue'