Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Update UniversalUpload.yml #47

Update UniversalUpload.yml

Update UniversalUpload.yml #47

name: Aristeas UniversalUpload Test
on:
push:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected]
- id: set-matrix
run: |
mods=()
for file in $(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}); do
if [[ -f "$(dirname $file)/modinfo.sbmi" ]]; then
modPath=$(dirname $file)
modId=$(grep -oP '(?<=<Id>)\d+(?=</Id>)' "$modPath/modinfo.sbmi")
mods+=("{\"value\":$modId,\"path\":\"$modPath\"}")
fi
done
mods=($(printf "%s\n" "${mods[@]}" | sort -u))
matrix=$(IFS=,; echo "${mods[*]}")
echo "matrix={\"include\":[$matrix]}" >> $GITHUB_OUTPUT
workshop-upload:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
steps:
- uses: actions/[email protected]
- name: Delay
run: sleep $((${{ strategy.job-index }} * 10))
- uses: AnarkisGaming/workshop@v1
with:
appID: 244850
login: true
publishedFileID: ${{ matrix.value }}
path: ${{ matrix.path }}
changelog: ${{ github.event.head_commit.message }}
env:
STEAM_ACCOUNT_NAME: ${{ secrets.accountname }}
STEAM_PASSWORD: ${{ secrets.password }}