-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
74 lines (64 loc) · 1.89 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
name: "gmod-upload"
description: "Packs a Garry's Mod addon to a .gma file and uploads to the Steam workshop"
branding:
icon: box
color: gray-dark
inputs:
changelog:
description: "Changelog"
required: false
default: ""
id:
description: "Workshop item id"
required: true
config:
description: "Path of addon.json, or json file to treat as such."
required: false
default: "addon.json"
runs:
using: "composite"
steps:
- uses: actions/checkout@master
- name: Download SteamCMD
shell: bash
run: |
sudo apt-get update
sudo apt-get install lib32gcc-s1
mkdir ~/Steam
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -C ~/Steam
- name: Download Lua 5.3
shell: bash
run: |
sudo apt-get install lua5.3
- name: Run gma packer
shell: bash
run: |
lua5.3 ${{ github.action_path }}/gma.lua ${{ inputs.id }}.gma ${{ inputs.config }}
- name: Create .vdf file
shell: bash
run: |
cat > workshop.vdf << EOF
"workshopitem" {
"appid" "4000"
"publishedfileid" "${{ inputs.id }}"
"contentfolder" "`pwd`/${{ inputs.id }}.gma"
"changenote" "${{ inputs.changelog }}"
}
EOF
- name: Run SteamCMD
shell: bash
run: |
~/Steam/steamcmd.sh +login $STEAM_USERNAME $STEAM_PASSWORD +workshop_build_item `pwd -P`/workshop.vdf +quit
- name: Print Errors
if: failure()
shell: bash
run: |
echo ~/Steam/logs/stderr.txt
echo "$(cat ~/Steam/logs/stderr.txt)"
echo
echo ~/Steam/logs/workshop_log.txt
echo "$(cat ~/Steam/logs/workshop_log.txt)"
echo
echo ~/Steam/workshopbuilds/depot_build_4000.log
echo "$(cat ~/Steam/workshopbuilds/depot_build_4000.log)"
exit 1