name: PySR backend update on: schedule: - cron: '00 00 * * *' workflow_dispatch: jobs: update_compat: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: 3.12 cache: pip - name: "Install dependencies" run: | python -m pip install --upgrade pip pip install tomlkit - name: "Get SymbolicRegression.jl latest version" id: get-latest run: | cd $(mktemp -d) git clone https://github.com/MilesCranmer/SymbolicRegression.jl cd SymbolicRegression.jl echo "version=$(git describe --tags --match='v*' --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT - name: "Update SymbolicRegression.jl version in PySR" run: | python .github/workflows/update_backend_version.py ${{ steps.get-latest.outputs.version }} - name: "Restore changes if no diff to `pysr/juliapkg.json`" run: | if git diff --quiet pysr/juliapkg.json; then echo "No changes to pysr/juliapkg.json. Restoring changes." git restore pyproject.toml fi - name: "Create PR if necessary" uses: peter-evans/create-pull-request@v6 with: title: "Automated update to backend: v${{ steps.get-latest.outputs.version }}" body: | This PR was automatically generated by the GitHub Action `.github/workflows/update-backend.yml` It updates the backend version to v${{ steps.get-latest.outputs.version }}. For a full description of the changes, see the backend changelog: [v${{ steps.get-latest.outputs.version }}](https://github.com/MilesCranmer/SymbolicRegression.jl/releases/tag/v${{ steps.get-latest.outputs.version }}). delete-branch: true commit-message: "Update backend version to v${{ steps.get-latest.outputs.version }}" add-paths: | pyproject.toml pysr/juliapkg.json