-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (111 loc) · 4.17 KB
/
publish_testpypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Publish to Test PyPI
on:
pull_request:
branches:
- dev_stage
- main
jobs:
testpypi:
runs-on: windows-2019
strategy:
max-parallel: 0
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
with: # for github push action
#persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Configure CMake
run: |
cmake ./src/ `
-G"Visual Studio 16 2019" `
-DCMAKE_GENERATOR_PLATFORM="x64" `
-DCMAKE_INSTALL_PREFIX="D:/a/dhart/dhart/build/Python" `
-DDHARTAPI_Config="All" `
-DDHARTAPI_EnableTests="False" `
-DCMAKE_CONFIGURATION_TYPES="Release" `
-DDHARTAPI_EnablePython="True" `
-DDHARTAPI_EnableCSharp="False" `
-DEmbree_DIR="D:/a/dhart/dhart/src/external/Embree"
- name: cmake
run: cmake --build build --config Release --verbose
# - name: Configure cmake
# run: |
# cd src
# cmake ./src/ -G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM="x64" -DCMAKE_INSTALL_PREFIX=".\..\build\Python" -DDHARTAPI_Config="All" -DDHARTAPI_EnableTests="False" -DCMAKE_CONFIGURATION_TYPES="Release" -DDHARTAPI_EnablePython="True" -DDHARTAPI_EnableCSharp="False" -DINSTALL_GTEST="False" ".\" 2>&1
# - name: cmake build
# run: |
# ls
# cd src
# cmake --build . --config Release
- name: cmake Install
run: |
ls
cd src
cmake --install .
- name: Add build directory to PATH
run: |
$env:PATH += ";D:/a/dhart/dhart/build/Python/bin"
- name: Check Install Location
run: |
cd "D:/a/dhart/dhart/build/Python"
ls
cd bin
ls
cd ..
cd dhart
ls
cd bin
ls
- name: Build and Install Wheel
run: |
cd "D:/a/dhart/dhart/build/Python"
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine build
python -m pip install numpy matplotlib scipy
- name: Increment Package Version
run: |
cd "D:/a/dhart/dhart/build/Python"
python -m pip install bump
python -m bump
# Step 4: Build the package
- name: Build the package
run: |
cd "D:/a/dhart/dhart/build/Python"
python -m build
ls
# python setup.py sdist bdist_wheel
# Step 5: Publish to Test PyPI
- name: Publish to Test PyPI
env:
TWINE_USERNAME: "__token__" # Required for Test PyPI token
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
cd "D:/a/dhart/dhart/build/Python"
ls
twine upload --repository testpypi dist/* --verbose
- name: Check Python Install
run: |
pip install -i https://test.pypi.org/simple/ dhart==0.2.24
- name: Try to import dhart
run: |
python -c "from dhart.spatialstructures import Graph"
python -c "import platform; print(platform.architecture())"
python -c "import dhart; print(dhart.__file__)"
- name: Run Sphinx from testpypi
run: |
cd "D:/a/dhart/dhart/build/Python"
python -m pip install flake8 pytest
python -m pip install sphinx numpydoc matplotlib
ls
cd "D:/a/dhart/dhart/docs/Python Docs"
ls
./make.bat clean
./make.bat html
./make.bat doctest