Skip to content

Commit

Permalink
rust: Attempt dynamic version resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed May 22, 2024
1 parent 69d5104 commit fe8a8db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Crates
on:
push:
# TODO: remove branches
branches: ["*"]
# branches: ["*"]
tags:
- "*"
workflow_dispatch:
Expand Down
13 changes: 7 additions & 6 deletions crates/bump-versions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import json
import sys
from pathlib import Path

import tomlkit

HERE = Path(__file__).parent
CRATES = json.loads((HERE / "release.json").read_text())

VERSION = "0.1.1-alpha.5"


def workspace(manifest, version):
manifest["workspace"]["package"]["version"] = version
Expand All @@ -28,11 +27,13 @@ def update(path, version, edit):
path.write_text(tomlkit.dumps(manifest))


def main():
update("..", VERSION, workspace)
def main(version):
update("..", version, workspace)
for name in CRATES:
update(name, VERSION, crate)
update(name, version, crate)


if __name__ == "__main__":
main()
if len(sys.argv) < 2:
raise ValueError(f"Pass version to {sys.argv[0]}")
main(sys.argv[1])
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ asv-publish = "asv publish --config benchmarks/asv.conf.json"
asv-show = "asv show --config benchmarks/asv.conf.json"
asv-clean = { "shell" = "rm -rf benchmarks/env benchmarks/html benchmarks/results" }
asv = ["asv-run", "asv-publish", "asv-preview"]
bump-version = "python crates/bump-versions.py"
bump-version = "python crates/bump-versions.py `git describe --tags`"
compile = "pip install -e crates/eko/"
rdocs.cmd = "cargo doc --workspace --no-deps"
rdocs.env = { RUSTDOCFLAGS = "--html-in-header crates/katex-header.html" }
Expand Down

0 comments on commit fe8a8db

Please sign in to comment.