Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- 'master'
paths:
- '**'

workflow_dispatch:

permissions:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/CI_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- 'master'
paths:
- '**'

workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/CI_apptainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- 'master'
paths:
- '**'
workflow_dispatch:

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/CI_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- 'master'
paths:
- '**'
workflow_dispatch:

jobs:
test:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/CI_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- 'master'
paths:
- '**'

workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: [ "master" ]
schedule:
- cron: '28 17 * * 1'
workflow_dispatch:

jobs:
analyze:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/update_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,23 @@ jobs:
run: |
if git diff --quiet pysr/juliapkg.json; then
echo "No changes to pysr/juliapkg.json. Restoring changes."
git restore pyproject.toml
git restore pyproject.toml .release-please-manifest.json
fi

- name: "Create PR if necessary"
id: cpr
uses: peter-evans/create-pull-request@v8
with:
branch: backend-update/v${{ steps.get-latest.outputs.version }}
title: "Automated update to backend: v${{ steps.get-latest.outputs.version }}"
title: "chore: update backend to 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 }}"
commit-message: "chore: update backend to v${{ steps.get-latest.outputs.version }}"
add-paths: |
.release-please-manifest.json
pyproject.toml
pysr/juliapkg.json

Expand All @@ -66,5 +67,9 @@ jobs:
run: |
ref="backend-update/v${{ steps.get-latest.outputs.version }}"
gh workflow run "Linux" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "macOS" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Windows" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "macOS" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Docker" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Apptainer" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Documentation" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "CodeQL" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
15 changes: 12 additions & 3 deletions .github/workflows/update_backend_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@

assert not new_backend_version.startswith("v"), "Version should not start with 'v'"

pyproject_toml = Path(__file__).parent / ".." / ".." / "pyproject.toml"
juliapkg_json = Path(__file__).parent / ".." / ".." / "pysr" / "juliapkg.json"
repo_root = Path(__file__).parent / ".." / ".."
pyproject_toml = repo_root / "pyproject.toml"
juliapkg_json = repo_root / "pysr" / "juliapkg.json"
release_please_manifest = repo_root / ".release-please-manifest.json"

with open(pyproject_toml) as toml_file:
pyproject_data = tomlkit.parse(toml_file.read())

with open(juliapkg_json) as f:
juliapkg_data = json.load(f)

with open(release_please_manifest) as f:
release_please_manifest_data = json.load(f)

current_version = pyproject_data["project"]["version"]
parts = current_version.split(".")

Expand Down Expand Up @@ -52,6 +57,7 @@
new_version = f"{major}.{minor}.{new_patch}{new_suffix}{extra_parts}"

pyproject_data["project"]["version"] = new_version
release_please_manifest_data["."] = new_version

# Update backend - maintain current format (either "rev" or "version")
backend_pkg = juliapkg_data["packages"]["SymbolicRegression"]
Expand All @@ -69,5 +75,8 @@

with open(juliapkg_json, "w") as f:
json.dump(juliapkg_data, f, indent=4)
# Ensure ends with newline
f.write("\n")

with open(release_please_manifest, "w") as f:
json.dump(release_please_manifest_data, f, indent=2)
f.write("\n")
Loading