@@ -57,10 +57,35 @@ jobs:
57
57
run : |
58
58
mkdir dist
59
59
./gmod/bin/gmad_linux create -folder publish -out dist/lambda.gma
60
+ - name : Setup steamcmd
61
+ uses : CyberAndrii/setup-steamcmd@v1
62
+
60
63
- name : Upload to Workshop
61
- uses : ZehMatt/steam-workshop-upload@569de82c2fdf3042af8491379fb698829ba63a9d
62
- with :
63
- appid : 4000
64
- itemid : ${{ inputs.workshop-id }}
65
- changenote : " List of changes: https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}/changelog.md"
66
- path : ' dist'
64
+ run : |
65
+ # Create the workshop.vdf file
66
+ cat << EOF > workshop.vdf
67
+ "workshopitem"
68
+ {
69
+ "appid" "4000"
70
+ "contentfolder" "${{ github.workspace }}/dist"
71
+ "changenote" "List of changes: https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}/changelog.md"
72
+ "publishedfileid" "${{ inputs.workshop-id }}"
73
+ }
74
+ EOF
75
+
76
+ # Debug: Display the workshop.vdf file
77
+ echo "Generated workshop.vdf:"
78
+ cat workshop.vdf
79
+
80
+ # Check if STEAM_TFASEED is provided for Steam Guard
81
+ if [[ -z "${STEAM_TFASEED}" ]]; then
82
+ echo "No Steam Guard 2FA seed provided, attempting login without code..."
83
+ steamcmd +@ShutdownOnFailedCommand 1 +login "${STEAM_USERNAME}" "${STEAM_PASSWORD}" +workshop_build_item workshop.vdf +quit
84
+ else
85
+ echo "Steam Guard 2FA seed provided, generating code..."
86
+ # Install Node.js for steam-guard-code (assuming it's a Node.js script)
87
+ npm install steam-totp
88
+ SGC=$(node -e "const steamTotp = require('steam-totp'); console.log(steamTotp.generateAuthCode('${STEAM_TFASEED}'));")
89
+ echo "Generated Steam Guard code: ${SGC}"
90
+ steamcmd +@ShutdownOnFailedCommand 1 +login "${STEAM_USERNAME}" "${STEAM_PASSWORD}" "${SGC}" +workshop_build_item workshop.vdf +quit
91
+ fi
0 commit comments