Skip to content

Generate data

Generate data #79859

name: Generate data
on:
schedule:
- cron: '*/5 * * * *'
push:
pull_request:
workflow_dispatch:
jobs:
linux:
strategy:
matrix:
swift_version: ['5.7']
runs-on: ubuntu-latest
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
container:
image: swift:${{ matrix.swift_version }}
steps:
- uses: actions/checkout@v3
- name: Configure git to trust the workspace despite the different owner
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build
run: swift build -c release
- name: Generate webview data
run: |
.build/release/sn3 webview > Data/splatnet3_webview_data.json
- name: Commit data
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add Data/*json
if test "$(git diff --name-only --cached 2>/dev/null | wc -l)" -gt "0" ; then git commit -m "Update data." && git push; else echo No changes found; fi