Added runtime fetcher from cooker

This commit is contained in:
XargonWan 2025-01-13 09:21:39 +09:00
parent 7af698ae3b
commit 6fabc5c0bb

View file

@ -20,6 +20,10 @@ on:
required: false required: false
type: string type: string
default: "ubuntu-latest" default: "ubuntu-latest"
FORCED_RUNTIME:
required: false
type: string
default: "false"
env: env:
DATE: ${{ github.run_id }} DATE: ${{ github.run_id }}
@ -55,6 +59,26 @@ jobs:
exit 1 exit 1
fi fi
- name: "Fetch and replace runtime values"
if: ${{ inputs.FORCED_RUNTIME == 'true' }}
run: |
MANIFEST_CONTENT=$(curl -s https://raw.githubusercontent.com/RetroDECK/RetroDECK/cooker/net.retrodeck.retrodeck.yml)
RUNTIME=$(echo "$MANIFEST_CONTENT" | yq e '.runtime' -)
RUNTIME_VERSION=$(echo "$MANIFEST_CONTENT" | yq e '.runtime-version' -)
SDK=$(echo "$MANIFEST_CONTENT" | yq e '.sdk' -)
for file in ./*.*.*.json ./*.*.*.yml ./*.*.*.yaml; do
if [[ -f "$file" ]]; then
if [[ "$file" == *.json ]]; then
jq ".runtime = \"$RUNTIME\" | .\"runtime-version\" = \"$RUNTIME_VERSION\" | .sdk = \"$SDK\"" "$file" > tmp.$$.json && mv tmp.$$.json "$file"
else
yq e -i ".runtime = \"$RUNTIME\"" "$file"
yq e -i ".runtime-version = \"$RUNTIME_VERSION\"" "$file"
yq e -i ".sdk = \"$SDK\"" "$file"
fi
fi
done
- name: "[DEBUG] Outputting manifest" - name: "[DEBUG] Outputting manifest"
if: ${{ inputs.DYNAMIC_MANIFEST == 'true' }} if: ${{ inputs.DYNAMIC_MANIFEST == 'true' }}
run: | run: |