File tree 3 files changed +74
-1
lines changed
3 files changed +74
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Nightly Build
2
+
3
+ on :
4
+ pull_request :
5
+
6
+ jobs :
7
+ build :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - name : Setup Python
11
+ uses : actions/setup-python@v5
12
+ with :
13
+ python-version : " 3.10"
14
+ architecture : x64
15
+ - name : Checkout
16
+ uses : actions/checkout@v4
17
+ - name : Install Dependencies
18
+ run : |
19
+ set -eux
20
+
21
+ pip install -U twine toml
22
+ - name : Build Docker
23
+ run : |
24
+ set -eux
25
+
26
+ docker build --progress=plain -t torchft-maturin .
27
+
28
+ - name : Set Nightly Version
29
+ run : |
30
+ set -eux
31
+
32
+ python scripts/patch_nightly_version.py
33
+
34
+ - name : Build Wheels
35
+ uses : PyO3/maturin-action@v1
36
+ with :
37
+ container : torchft-maturin
38
+ args : --release --out dist --interpreter '3.10'
39
+
40
+ - name : Twine Check
41
+ run : twine check --strict dist/*
42
+
43
+ - name : Upload to Pypi
44
+ run : twine upload dist/*
45
+ env :
46
+ TWINE_USERNAME : __token__
47
+ TWINE_PASSWORD : ${{ secrets.pypi_token }}
Original file line number Diff line number Diff line change 7
7
fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
8
8
tonic_build:: configure ( )
9
9
. protoc_arg ( "--experimental_allow_proto3_optional" )
10
- . compile_protos ( & [ "proto/torchft.proto" ] , & [ "proto" ] ) ?;
10
+ . compile ( & [ "proto/torchft.proto" ] , & [ "proto" ] ) ?;
11
11
Ok ( ( ) )
12
12
}
Original file line number Diff line number Diff line change
1
+ from datetime import date
2
+
3
+ import toml
4
+
5
+
6
+ def get_nightly_version ():
7
+ today = date .today ()
8
+ return f"{ today .year } .{ today .month } .{ today .day } "
9
+
10
+
11
+ CARGO_FILE = "Cargo.toml"
12
+ PYPROJECT_FILE = "pyproject.toml"
13
+
14
+
15
+ cargo = toml .load (CARGO_FILE )
16
+ cargo ["package" ]["version" ] = get_nightly_version ()
17
+
18
+ print (cargo )
19
+
20
+ with open (CARGO_FILE , "w" ) as f :
21
+ toml .dump (cargo , f )
22
+
23
+ pyproject = toml .load (PYPROJECT_FILE )
24
+ pyproject ["project" ]["name" ] = "torchft-nightly"
25
+
26
+ print (pyproject )
You can’t perform that action at this time.
0 commit comments