gitronics 0.4.0__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitronics-0.5.4/.github/workflows/ci.yml +91 -0
- gitronics-0.5.4/.github/workflows/docs.yml +46 -0
- gitronics-0.5.4/.github/workflows/release.yml +137 -0
- gitronics-0.5.4/.gitignore +7 -0
- gitronics-0.5.4/Cargo.lock +1341 -0
- gitronics-0.5.4/Cargo.toml +33 -0
- gitronics-0.5.4/PKG-INFO +9 -0
- gitronics-0.5.4/docs/best-practices.md +99 -0
- gitronics-0.5.4/docs/changelog.md +25 -0
- gitronics-0.5.4/docs/examples.md +110 -0
- gitronics-0.5.4/docs/getting-started.md +105 -0
- gitronics-0.5.4/docs/index.md +45 -0
- gitronics-0.5.4/docs/installation.md +54 -0
- gitronics-0.5.4/docs/requirements.txt +3 -0
- gitronics-0.5.4/docs/usage/build.md +52 -0
- gitronics-0.5.4/docs/usage/configuration.md +162 -0
- gitronics-0.5.4/docs/usage/migrate.md +63 -0
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_3.mcnp → gitronics-0.5.4/example_project/assessment_specific/filler_model_3.mcnp +9 -8
- gitronics-0.5.4/example_project/assessment_specific/small_override.yaml +5 -0
- {gitronics-0.4.0 → gitronics-0.5.4}/example_project/configurations/valid_configuration.yaml +5 -3
- gitronics-0.5.4/example_project/output/.gitignore +2 -0
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/data_cards/materials.mat → gitronics-0.5.4/example_project/reference_model/data_cards/materials.mat +5 -0
- {gitronics-0.4.0/example_project → gitronics-0.5.4/example_project/reference_model}/data_cards/my_transform.transform +1 -1
- {gitronics-0.4.0/tests/test_resources/valid_project/models → gitronics-0.5.4/example_project/reference_model}/envelope_structure.mcnp +7 -7
- {gitronics-0.4.0/tests/test_resources/valid_project/models → gitronics-0.5.4/example_project/reference_model/filler_models}/filler_model_1.mcnp +8 -8
- {gitronics-0.4.0/example_project/models → gitronics-0.5.4/example_project/reference_model/filler_models}/filler_model_2.mcnp +7 -6
- gitronics-0.5.4/mkdocs.yml +77 -0
- gitronics-0.5.4/pyproject.toml +22 -0
- gitronics-0.5.4/python/gitronics/__init__.py +25 -0
- gitronics-0.5.4/python/tests/test_cli_works.py +13 -0
- gitronics-0.5.4/resources/simple_model.mcnp +32 -0
- gitronics-0.5.4/src/build_model.rs +227 -0
- gitronics-0.5.4/src/cli.rs +75 -0
- gitronics-0.5.4/src/lib.rs +13 -0
- gitronics-0.5.4/src/main.rs +8 -0
- gitronics-0.5.4/src/migrate_model.rs +236 -0
- gitronics-0.5.4/src/model_config.rs +211 -0
- gitronics-0.5.4/src/project_manager/load_metadata.rs +45 -0
- gitronics-0.5.4/src/project_manager/load_model_config.rs +179 -0
- gitronics-0.5.4/src/project_manager/load_project_files.rs +148 -0
- gitronics-0.5.4/src/project_manager.rs +112 -0
- gitronics-0.5.4/src/python.rs +16 -0
- gitronics-0.5.4/src/types.rs +259 -0
- gitronics-0.5.4/src/utils.rs +195 -0
- gitronics-0.5.4/tests/test_example_project.rs +248 -0
- gitronics-0.4.0/.github/workflows/publish.yml +0 -26
- gitronics-0.4.0/.gitignore +0 -9
- gitronics-0.4.0/.python-version +0 -1
- gitronics-0.4.0/PKG-INFO +0 -19
- gitronics-0.4.0/README.md +0 -6
- gitronics-0.4.0/docs/source/conf.py +0 -33
- gitronics-0.4.0/docs/source/index.rst +0 -139
- gitronics-0.4.0/docs/source/requirements.txt +0 -2
- gitronics-0.4.0/example_project/assembled/assembled.mcnp +0 -264
- gitronics-0.4.0/example_project/assembled/assembled.metadata +0 -1
- gitronics-0.4.0/example_project/build_model.py +0 -25
- gitronics-0.4.0/example_project/configurations/small_override.yaml +0 -3
- gitronics-0.4.0/example_project/data_cards/materials.mat +0 -9
- gitronics-0.4.0/example_project/models/envelope_structure.mcnp +0 -217
- gitronics-0.4.0/example_project/models/filler_model_1.mcnp +0 -33
- gitronics-0.4.0/example_project/models/filler_model_3.mcnp +0 -33
- gitronics-0.4.0/example_project/models/filler_model_3.metadata +0 -0
- gitronics-0.4.0/pyproject.toml +0 -31
- gitronics-0.4.0/readthedocs.yaml +0 -34
- gitronics-0.4.0/src/gitronics/__init__.py +0 -4
- gitronics-0.4.0/src/gitronics/compose_model.py +0 -42
- gitronics-0.4.0/src/gitronics/file_discovery.py +0 -29
- gitronics-0.4.0/src/gitronics/file_readers.py +0 -175
- gitronics-0.4.0/src/gitronics/generate_model.py +0 -130
- gitronics-0.4.0/src/gitronics/helpers.py +0 -37
- gitronics-0.4.0/src/gitronics/project_checker.py +0 -288
- gitronics-0.4.0/src/gitronics/project_manager.py +0 -143
- gitronics-0.4.0/tests/test_compose_model.py +0 -67
- gitronics-0.4.0/tests/test_file_discovery.py +0 -22
- gitronics-0.4.0/tests/test_file_readers.py +0 -303
- gitronics-0.4.0/tests/test_generate_model.py +0 -47
- gitronics-0.4.0/tests/test_project_checker.py +0 -189
- gitronics-0.4.0/tests/test_project_manager.py +0 -119
- gitronics-0.4.0/tests/test_resources/duplicated_filename_project/duplicated_name.mat +0 -0
- gitronics-0.4.0/tests/test_resources/duplicated_filename_project/duplicated_name.mcnp +0 -0
- gitronics-0.4.0/tests/test_resources/duplicated_filename_project/duplicated_name.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/expected_file_valid_configuration.mcnp +0 -264
- gitronics-0.4.0/tests/test_resources/invalid_suffix_project/my_file.wrong +0 -0
- gitronics-0.4.0/tests/test_resources/missing_metadata_project/my_file.mcnp +0 -0
- gitronics-0.4.0/tests/test_resources/valid_project/configurations/envelope_not_accounted.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project/configurations/overrides_configuration.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project/configurations/small_config.yaml +0 -1
- gitronics-0.4.0/tests/test_resources/valid_project/configurations/small_override.yaml +0 -3
- gitronics-0.4.0/tests/test_resources/valid_project/configurations/valid_configuration.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/fine_mesh.tally +0 -19
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/materials.mat +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/my_source.source +0 -7
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/my_transform.transform +0 -3
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/ssw_card.tally +0 -3
- gitronics-0.4.0/tests/test_resources/valid_project/data_cards/volumetric_source.source +0 -7
- gitronics-0.4.0/tests/test_resources/valid_project/models/envelope_structure.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_1.metadata +0 -2
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_2.mcnp +0 -33
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_2.metadata +0 -3
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_3.mcnp +0 -33
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_3.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_repeat_surface.mcnp +0 -33
- gitronics-0.4.0/tests/test_resources/valid_project/models/filler_model_repeat_surface.metadata +0 -2
- gitronics-0.4.0/tests/test_resources/valid_project/models/my_envelope_structure.mcnp +0 -217
- gitronics-0.4.0/tests/test_resources/valid_project/models/my_envelope_structure.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/data_cards/fine_mesh.tally +0 -19
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/data_cards/my_transform.transform +0 -3
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/data_cards/volumetric_source.source +0 -7
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_env_struct.yaml +0 -8
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_filler_path.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_materials_path.yaml +0 -8
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_source_path.yaml +0 -6
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_tallies_path.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_tr_for_filler.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/missing_transforms_path.yaml +0 -7
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/wrong_env_struct_path.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/invalid_configurations/wrong_envelope_name.yaml +0 -9
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/envelope_structure.mcnp +0 -217
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/envelope_structure.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_1.mcnp +0 -33
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_1.metadata +0 -2
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_2.mcnp +0 -33
- gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models/filler_model_3.metadata +0 -0
- gitronics-0.4.0/tests/test_resources/wrong_files/only_cells_block.mcnp +0 -5
- gitronics-0.4.0/tests/test_resources/wrong_files/wrong_cells_block.mcnp +0 -32
- gitronics-0.4.0/tests/test_resources/wrong_files/wrong_data_card.mat +0 -2
- gitronics-0.4.0/tests/test_resources/wrong_files/wrong_suffix.wrong +0 -0
- gitronics-0.4.0/tests/test_resources/wrong_files/wrong_surfaces_block.mcnp +0 -27
- gitronics-0.4.0/uv.lock +0 -295
- {gitronics-0.4.0 → gitronics-0.5.4}/LICENSE +0 -0
- {gitronics-0.4.0/docs/source/_static → gitronics-0.5.4/docs}/logo.png +0 -0
- /gitronics-0.4.0/example_project/models/filler_model_2.metadata → /gitronics-0.5.4/example_project/assessment_specific/filler_model_3.metadata +0 -0
- {gitronics-0.4.0/example_project → gitronics-0.5.4/example_project/reference_model}/data_cards/fine_mesh.tally +0 -0
- {gitronics-0.4.0/example_project → gitronics-0.5.4/example_project/reference_model}/data_cards/volumetric_source.source +0 -0
- {gitronics-0.4.0/example_project/models → gitronics-0.5.4/example_project/reference_model}/envelope_structure.metadata +0 -0
- {gitronics-0.4.0/example_project/models → gitronics-0.5.4/example_project/reference_model/filler_models}/filler_model_1.metadata +0 -0
- {gitronics-0.4.0/tests/test_resources/valid_project _with_invalid_configurations/models → gitronics-0.5.4/example_project/reference_model/filler_models}/filler_model_2.metadata +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
rust:
|
|
14
|
+
name: Rust tests (${{ matrix.os }})
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install Rust stable
|
|
23
|
+
uses: dtolnay/rust-toolchain@stable
|
|
24
|
+
with:
|
|
25
|
+
components: clippy
|
|
26
|
+
|
|
27
|
+
- name: Set up Python (Required for PyO3 test linking)
|
|
28
|
+
id: setup-python
|
|
29
|
+
uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.11"
|
|
32
|
+
|
|
33
|
+
- name: Configure PyO3 Python path
|
|
34
|
+
shell: bash
|
|
35
|
+
run: |
|
|
36
|
+
echo "PYO3_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
|
|
37
|
+
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
38
|
+
PYLIB=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
|
39
|
+
PYVER=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LDVERSION'))")
|
|
40
|
+
echo "RUSTFLAGS=-L${PYLIB} -lpython${PYVER}" >> $GITHUB_ENV
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Cache cargo registry
|
|
44
|
+
uses: actions/cache@v4
|
|
45
|
+
with:
|
|
46
|
+
path: |
|
|
47
|
+
~/.cargo/registry
|
|
48
|
+
~/.cargo/git
|
|
49
|
+
target
|
|
50
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
51
|
+
|
|
52
|
+
- name: Test
|
|
53
|
+
run: cargo test --workspace --features pyo3/auto-initialize
|
|
54
|
+
|
|
55
|
+
- name: Clippy
|
|
56
|
+
run: cargo clippy --workspace -- -D warnings
|
|
57
|
+
|
|
58
|
+
python:
|
|
59
|
+
name: Python tests (${{ matrix.os }})
|
|
60
|
+
runs-on: ${{ matrix.os }}
|
|
61
|
+
strategy:
|
|
62
|
+
matrix:
|
|
63
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
- name: Install Rust stable
|
|
68
|
+
uses: dtolnay/rust-toolchain@stable
|
|
69
|
+
|
|
70
|
+
- name: Set up Python
|
|
71
|
+
uses: actions/setup-python@v5
|
|
72
|
+
with:
|
|
73
|
+
python-version: "3.11"
|
|
74
|
+
|
|
75
|
+
- name: Cache cargo registry
|
|
76
|
+
uses: actions/cache@v4
|
|
77
|
+
with:
|
|
78
|
+
path: |
|
|
79
|
+
~/.cargo/registry
|
|
80
|
+
~/.cargo/git
|
|
81
|
+
target
|
|
82
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
83
|
+
|
|
84
|
+
- name: Install maturin and pytest
|
|
85
|
+
run: pip install maturin pytest
|
|
86
|
+
|
|
87
|
+
- name: Build and install Python package (dev mode)
|
|
88
|
+
run: pip install -e .
|
|
89
|
+
|
|
90
|
+
- name: Run Python tests
|
|
91
|
+
run: pytest
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v[0-9]+.[0-9]+.[0-9]*"
|
|
7
|
+
# Allow manual triggering from the Actions tab
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write # needed to push to gh-pages branch
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
deploy-docs:
|
|
15
|
+
name: Build & deploy documentation
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
# Fetch full history so mike can read previous deployments
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
|
|
29
|
+
- name: Install documentation dependencies
|
|
30
|
+
run: pip install -r docs/requirements.txt
|
|
31
|
+
|
|
32
|
+
- name: Extract version from tag
|
|
33
|
+
id: version
|
|
34
|
+
run: |
|
|
35
|
+
# Strip the leading "v" so MkDocs sees "1.2.3", not "v1.2.3"
|
|
36
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
37
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
38
|
+
|
|
39
|
+
- name: Build & deploy to GitHub Pages
|
|
40
|
+
run: |
|
|
41
|
+
git config user.name "github-actions[bot]"
|
|
42
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
43
|
+
# Deploy this version and update the "latest" alias
|
|
44
|
+
pip install mike
|
|
45
|
+
mike deploy --push --update-aliases "${{ steps.version.outputs.version }}" latest
|
|
46
|
+
mike set-default --push latest
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v[0-9]+.[0-9]+.[0-9]*"
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CARGO_TERM_COLOR: always
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
# ──────────────────────────────────────────────
|
|
13
|
+
# 1. Publish gitronics crate to crates.io
|
|
14
|
+
# ──────────────────────────────────────────────
|
|
15
|
+
publish-crate:
|
|
16
|
+
name: Publish to crates.io
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install Rust stable
|
|
22
|
+
uses: dtolnay/rust-toolchain@stable
|
|
23
|
+
|
|
24
|
+
- name: Set up Python (Required for PyO3 build)
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
|
|
29
|
+
- name: Set version from tag
|
|
30
|
+
run: |
|
|
31
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
32
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
33
|
+
# Regenerate Cargo.lock with updated version
|
|
34
|
+
cargo update --workspace
|
|
35
|
+
|
|
36
|
+
- name: Publish gitronics
|
|
37
|
+
env:
|
|
38
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
|
|
39
|
+
run: cargo publish -p gitronics --allow-dirty
|
|
40
|
+
|
|
41
|
+
# ──────────────────────────────────────────────
|
|
42
|
+
# 2. Build Python wheels for each platform
|
|
43
|
+
# ──────────────────────────────────────────────
|
|
44
|
+
build-wheels:
|
|
45
|
+
name: Build wheels (${{ matrix.target }})
|
|
46
|
+
runs-on: ${{ matrix.os }}
|
|
47
|
+
strategy:
|
|
48
|
+
matrix:
|
|
49
|
+
include:
|
|
50
|
+
# Linux x86_64 (manylinux via docker)
|
|
51
|
+
- os: ubuntu-latest
|
|
52
|
+
target: x86_64
|
|
53
|
+
# Linux aarch64 (cross-compiled)
|
|
54
|
+
- os: ubuntu-latest
|
|
55
|
+
target: aarch64
|
|
56
|
+
# macOS x86_64
|
|
57
|
+
- os: macos-latest
|
|
58
|
+
target: x86_64
|
|
59
|
+
# macOS Apple Silicon
|
|
60
|
+
- os: macos-latest
|
|
61
|
+
target: aarch64
|
|
62
|
+
# Windows x86_64
|
|
63
|
+
- os: windows-latest
|
|
64
|
+
target: x86_64
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
|
|
69
|
+
- name: Set version from tag
|
|
70
|
+
shell: bash
|
|
71
|
+
run: |
|
|
72
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
73
|
+
if [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
74
|
+
sed -i '' "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
75
|
+
else
|
|
76
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
- name: Build wheels
|
|
80
|
+
uses: PyO3/maturin-action@v1
|
|
81
|
+
with:
|
|
82
|
+
target: ${{ matrix.target }}
|
|
83
|
+
args: --release --out dist
|
|
84
|
+
# Use manylinux for Linux builds to maximise compatibility
|
|
85
|
+
manylinux: auto
|
|
86
|
+
|
|
87
|
+
- name: Upload wheels
|
|
88
|
+
uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
91
|
+
path: dist
|
|
92
|
+
|
|
93
|
+
# ──────────────────────────────────────────────
|
|
94
|
+
# 3. Build a pure-Python sdist (source dist)
|
|
95
|
+
# ──────────────────────────────────────────────
|
|
96
|
+
build-sdist:
|
|
97
|
+
name: Build sdist
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/checkout@v4
|
|
101
|
+
|
|
102
|
+
- name: Set version from tag
|
|
103
|
+
run: |
|
|
104
|
+
VERSION="${GITHUB_REF_NAME#v}"
|
|
105
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
|
|
106
|
+
|
|
107
|
+
- name: Build sdist
|
|
108
|
+
uses: PyO3/maturin-action@v1
|
|
109
|
+
with:
|
|
110
|
+
command: sdist
|
|
111
|
+
args: --out dist
|
|
112
|
+
|
|
113
|
+
- name: Upload sdist
|
|
114
|
+
uses: actions/upload-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
name: sdist
|
|
117
|
+
path: dist
|
|
118
|
+
|
|
119
|
+
# ──────────────────────────────────────────────
|
|
120
|
+
# 4. Publish wheels + sdist to PyPI
|
|
121
|
+
# ──────────────────────────────────────────────
|
|
122
|
+
publish-pypi:
|
|
123
|
+
name: Publish to PyPI
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
needs: [build-wheels, build-sdist]
|
|
126
|
+
environment: pypi
|
|
127
|
+
permissions:
|
|
128
|
+
id-token: write # for Trusted Publishing (OIDC) — no token secret needed
|
|
129
|
+
steps:
|
|
130
|
+
- name: Download all artifacts
|
|
131
|
+
uses: actions/download-artifact@v4
|
|
132
|
+
with:
|
|
133
|
+
path: dist
|
|
134
|
+
merge-multiple: true
|
|
135
|
+
|
|
136
|
+
- name: Publish to PyPI
|
|
137
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|