File tree Expand file tree Collapse file tree 2 files changed +37
-20
lines changed
Expand file tree Collapse file tree 2 files changed +37
-20
lines changed Original file line number Diff line number Diff line change 2121 - ' Urban Synergy Unleashed;3371689443'
2222 - ' USU LLWA;3387021675'
2323 - ' USU Morgenrote;3371690718'
24+ update-description :
25+ description : ' Update description?'
26+ required : true
27+ default : ' true'
28+ type : choice
29+ options :
30+ - ' true'
31+ - ' false'
32+
2433
2534jobs :
2635 release :
@@ -42,15 +51,26 @@ jobs:
4251 rm -f "${{ steps.metadata.outputs.mod-name }}/vic3-tiger.conf"
4352 rm -f "${{ steps.metadata.outputs.mod-name }}/design_notes.txt"
4453 # Use rm -f for files and rm -rf for folders.
45-
54+
4655 # Create mod metadata for the steam release
4756 # Uses STEAM_PAGE.bbcode to update steam description
57+ - name : Create Workshop Metadata with Description
58+ if : ${{ inputs.update-description == 'true' }}
59+ shell : bash
60+ run : |
61+ ./script/create-release-vdf.sh "${{ github.workspace }}/${{ steps.metadata.outputs.mod-name }}" "${{ steps.metadata.outputs.mod-id }}" ../steam-release/STEAM_PAGE.bbcode
62+
63+ - name : Create Workshop Metadata without Description
64+ if : ${{ inputs.update-description == 'false' }}
65+ shell : bash
66+ run : |
67+ ./script/create-release-vdf.sh "${{ github.workspace }}/${{ steps.metadata.outputs.mod-name }}" "${{ steps.metadata.outputs.mod-id }}"
68+
4869 # Report: Generated metadata
49- - name : Create Workshop Metadata
70+ - name : Process Workshop Metadata
5071 id : steam-metadata
5172 shell : bash
5273 run : |
53- ./script/create-release-vdf.sh "${{ github.workspace }}/${{ steps.metadata.outputs.mod-name }}" ../steam-release/STEAM_PAGE.bbcode "${{ steps.metadata.outputs.mod-id }}"
5474 mv workshop.vdf ../steam-release/workshop.vdf
5575 echo "vdf=$(realpath ../steam-release/workshop.vdf)" >> "$GITHUB_OUTPUT"
5676 echo "# Workflow Metadata" >> $GITHUB_STEP_SUMMARY
Original file line number Diff line number Diff line change 1010 printf ' Usage: ./create-release-vdf.sh MOD_DIR DESC_FILE [MOD_ID]'
1111 exit 1
1212fi
13- # Check mod description
14- if [ -f " $2 " ]
15- then
16- description=" $( cat < " $2 " ) "
17- description=${description// $' \n ' / \\ n}
18- description=${description// $' \t ' / \\ t}
19- description=${description// \" / \\\" }
20- else
21- printf ' Missing Steam description'
22- printf ' \n'
23- printf ' Usage: ./create-release-vdf.sh MOD_DIR DESC_FILE [MOD_ID]'
24- exit 1
25- fi
2613
2714title=$( grep -Po ' (?<=\s\"name\"\s:\s\").+(?=\",)' " $mod_path /.metadata/metadata.json" )
2815
2916# Read mod id
30- if [ -n " $3 " ]
17+ if [ -n " $2 " ]
3118then
32- mod_id=" $3 "
19+ mod_id=" $2 "
3320else
3421 mod_id=' 0'
3522fi
3623
24+ # Check mod description
25+ if [ -f " $3 " ]
26+ then
27+ description=" $( cat < " $3 " ) "
28+ description=${description// \" / \\\" }
29+ fi
30+
3731# Clean up old file
3832printf ' ' > workshop.vdf
3933
@@ -51,8 +45,11 @@ printf '\t"previewfile" "%s/thumbnail.png"' "$mod_path" >> workshop.vdf
5145printf ' \n' >> workshop.vdf
5246printf ' \t"title" "%s"' " $title " >> workshop.vdf
5347printf ' \n' >> workshop.vdf
54- printf ' \t"description" "%s"' " $description " >> workshop.vdf
55- printf ' \n' >> workshop.vdf
48+ if [ -f " $3 " ]
49+ then
50+ printf ' \t"description" "%s"' " $description " >> workshop.vdf
51+ printf ' \n' >> workshop.vdf
52+ fi
5653printf ' }' >> workshop.vdf
5754
5855cat workshop.vdf
You can’t perform that action at this time.
0 commit comments