mirror of
https://github.com/tombi-toml/tombi.git
synced 2025-12-23 09:19:21 +00:00
feat: ci.
This commit is contained in:
parent
1f5e60a890
commit
df86885867
2 changed files with 26 additions and 0 deletions
10
.github/workflows/release_python.yml
vendored
10
.github/workflows/release_python.yml
vendored
|
|
@ -35,6 +35,8 @@ jobs:
|
|||
target: ppc64le
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: python python/set_version.py
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
|
|
@ -63,6 +65,8 @@ jobs:
|
|||
target: armv7
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: python python/set_version.py
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
|
|
@ -87,6 +91,8 @@ jobs:
|
|||
target: x86
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: python python/set_version.py
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
|
|
@ -110,6 +116,8 @@ jobs:
|
|||
target: aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: python python/set_version.py
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
|
|
@ -126,6 +134,8 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: python python/set_version.py
|
||||
- name: Build sdist
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
|
|
|
|||
16
python/set_version.py
Normal file
16
python/set_version.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
project_root = Path(__file__).parents[1].absolute()
|
||||
|
||||
pyproject_toml_path = project_root / "pyproject.toml"
|
||||
|
||||
with open(pyproject_toml_path, "r") as f:
|
||||
contents = f.read()
|
||||
|
||||
with open(pyproject_toml_path, "w") as f:
|
||||
if (github_ref := os.getenv("GITHUB_REF")) and github_ref.startswith("refs/tags/"):
|
||||
version = github_ref.replace("refs/tags/v", "")
|
||||
contents = contents.replace('version = "0.0.0"', f'version = "{version}"')
|
||||
|
||||
f.write(contents)
|
||||
Loading…
Add table
Add a link
Reference in a new issue