Skip to content

Commit aaa5d96

Browse files
committed
Download depot manifest and compare it, before installing via steacmd
1 parent 4b8d3cb commit aaa5d96

7 files changed

Lines changed: 67 additions & 13 deletions

.github/workflows/Update.Unturned.Redist.yaml

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
variant:
99
description: 'Which variant to update'
1010
required: true
11-
default: 'client'
11+
default: 'all'
1212
type: choice
1313
options:
1414
- all
@@ -65,13 +65,19 @@ jobs:
6565
fail-fast: false
6666

6767
steps:
68-
- name: Determine APP_ID and REDIST_DIR
68+
- name: Determine APP_ID, APP_BRANCH_NAME, APP_DEPOT_ID, and REDIST_DIR
6969
id: vars
7070
run: |
7171
if [[ "${{ matrix.variant }}" == client || "${{ matrix.variant }}" == client-preview || "${{ matrix.variant }}" == client-preview-old ]]; then
7272
echo "APP_ID=304930" >> $GITHUB_ENV
73+
echo "APP_DEPOT_ID=304931" >> $GITHUB_ENV
7374
else
7475
echo "APP_ID=1110390" >> $GITHUB_ENV
76+
echo "APP_DEPOT_ID=1110391" >> $GITHUB_ENV
77+
fi
78+
79+
if [[ "${{ matrix.variant }}" == client-preview || "${{ matrix.variant }}" == server-preview || "${{ matrix.variant }}" == client-preview-old || "${{ matrix.variant }}" == server-preview-old ]]; then
80+
echo "APP_BRANCH_NAME=preview" >> $GITHUB_ENV
7581
fi
7682
7783
case "${{ matrix.variant }}" in
@@ -94,15 +100,6 @@ jobs:
94100
ref: master
95101
token: ${{ secrets.GITHUB_TOKEN }}
96102

97-
- name: Download update tool
98-
uses: robinraju/release-downloader@v1
99-
with:
100-
repository: RocketModFix/UnturnedRedistUpdateTool
101-
latest: true
102-
fileName: UnturnedRedistUpdateTool.zip
103-
out-file-path: redist_tool
104-
extract: true
105-
106103
- name: Setup .NET
107104
uses: actions/setup-dotnet@v4
108105
env:
@@ -112,15 +109,72 @@ jobs:
112109
with:
113110
dotnet-version: 9.x
114111

112+
- name: Download depot downloader
113+
uses: robinraju/release-downloader@v1
114+
with:
115+
repository: SteamRE/DepotDownloader
116+
latest: true
117+
fileName: DepotDownloader-linux-x64.zip
118+
out-file-path: depot_downloader
119+
tag: "DepotDownloader_3.4.0" # Pin it's version to avoid breaking changes.
120+
extract: true
121+
122+
- name: Compare current vs saved manifest
123+
id: compare_manifest
124+
run: |
125+
MANIFEST_FILE="redist/redist-manifests/.manifest.${{ matrix.variant }}.txt"
126+
manifest_output=$(dotnet depot_downloader/DepotDownloader.dll \
127+
-app $APP_ID \
128+
-depot $APP_DEPOT_ID \
129+
-username ${{ secrets.STEAM_USERNAME }} \
130+
-password ${{ secrets.STEAM_PASSWORD }} \
131+
-manifest-only \
132+
-dir redist/temp_depots)
133+
134+
current_manifest=$(echo "$manifest_output" | grep -oE '[0-9]{19}' | head -n 1)
135+
echo "Current manifest: $current_manifest"
136+
137+
if [ -f "$MANIFEST_FILE" ]; then
138+
previous_manifest=$(cat "$MANIFEST_FILE")
139+
else
140+
previous_manifest=""
141+
fi
142+
143+
echo "Previous manifest: $previous_manifest"
144+
145+
if [ "$current_manifest" != "$previous_manifest" ]; then
146+
echo "Manifest changed"
147+
echo "$current_manifest" > "$MANIFEST_FILE"
148+
echo "manifest_changed=true" >> $GITHUB_OUTPUT
149+
else
150+
echo "Manifest unchanged"
151+
echo "manifest_changed=false" >> $GITHUB_OUTPUT
152+
fi
153+
154+
- name: Skip unchanged manifest
155+
if: steps.compare_manifest.outputs.manifest_changed == 'false'
156+
run: |
157+
echo "No manifest changes for ${{ matrix.variant }}. Skipping update steps."
158+
exit 0
159+
160+
- name: Download update tool
161+
uses: robinraju/release-downloader@v1
162+
with:
163+
repository: RocketModFix/UnturnedRedistUpdateTool
164+
latest: true
165+
fileName: UnturnedRedistUpdateTool.zip
166+
out-file-path: redist_tool
167+
extract: true
168+
115169
- name: Setup SteamCMD
116170
uses: CyberAndrii/setup-steamcmd@v1
117171

118172
- name: Update game files
119173
run: |
120-
if [[ "${{ matrix.variant }}" == "client" || "${{ matrix.variant }}" == "server" ]]; then
174+
if [[ "$APP_BRANCH_NAME" == ""]]; then
121175
steamcmd +force_install_dir $GITHUB_WORKSPACE +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} +app_update $APP_ID -validate +quit
122176
else
123-
steamcmd +force_install_dir $GITHUB_WORKSPACE +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} +app_update $APP_ID -beta preview -validate +quit
177+
steamcmd +force_install_dir $GITHUB_WORKSPACE +login ${{ secrets.STEAM_USERNAME }} ${{ secrets.STEAM_PASSWORD }} +app_update $APP_ID -beta $APP_BRANCH_NAME -validate +quit
124178
fi
125179
126180
- name: Run redist updater

redist/redist-manifests/.manifest.redist-client-preview-old.txt

Whitespace-only changes.

redist/redist-manifests/.manifest.redist-client-preview.txt

Whitespace-only changes.

redist/redist-manifests/.manifest.redist-client.txt

Whitespace-only changes.

redist/redist-manifests/.manifest.redist-server-preview-old.txt

Whitespace-only changes.

redist/redist-manifests/.manifest.redist-server-preview.txt

Whitespace-only changes.

redist/redist-manifests/.manifest.redist-server.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)