@@ -5,6 +5,13 @@ name: CI
5
5
env :
6
6
python.version : 3.8
7
7
python.venv : ' testvenv'
8
+ # Following env vars when changed will "reset" the mentioned cache,
9
+ # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-...
10
+ # You should go up in number, if you go down (or repeat a previous value)
11
+ # you might end up reusing a previous cache if it haven't been deleted already.
12
+ # It applies 7 days retention policy by default.
13
+ RESET_PIP_CACHE : 0
14
+ PACKAGE_NAME : PyAEDT
8
15
# Controls when the workflow will run
9
16
on :
10
17
# Triggers the workflow on push or pull request events but only for the main branch
35
42
with :
36
43
python-version : ${{ matrix.python-version }}
37
44
45
+ - name : Linux pip cache
46
+ uses : actions/cache@v2
47
+ if : ${{ runner.os == 'Linux' }}
48
+ with :
49
+ path : ~/.cache/pip
50
+ key : Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_tests.txt') }}
51
+ restore-keys : |
52
+ Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}
53
+
54
+ - name : Window pip cache
55
+ uses : actions/cache@v2
56
+ if : ${{ runner.os == 'Windows' }}
57
+ with :
58
+ path : ~\AppData\Local\pip\Cache
59
+ key : Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_tests*.txt') }}
60
+ restore-keys : |
61
+ Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}
62
+
63
+ - name : Install PyAEDT
64
+ run : pip install .
65
+
66
+ # - name: Test import
67
+ # working-directory: tests
68
+ # run: python -c "import pyaedt"
69
+
70
+ - name : Retrieve PyAEDT version
71
+ run : |
72
+ echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
73
+ echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
74
+ id : version
75
+
76
+ - name : Generate wheelhouse
77
+ run : |
78
+ pip install wheel setuptools -U
79
+ pip wheel . -w wheelhouse
80
+
81
+
82
+ - name : Zip wheelhouse
83
+ uses : vimtor/action-zip@v1
84
+ with :
85
+ files : wheelhouse
86
+ dest : ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip
87
+
88
+ - name : Upload Wheelhouse
89
+ uses : actions/upload-artifact@v2
90
+ with :
91
+ name : ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}
92
+ path : ' *.zip'
93
+ retention-days : 7
94
+
38
95
- name : ' Create virtual env'
39
96
run : |
40
97
python -m venv testenv
@@ -107,3 +164,13 @@ jobs:
107
164
env :
108
165
TWINE_USERNAME : __token__
109
166
TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
167
+
168
+ - name : Release
169
+ uses : softprops/action-gh-release@v1
170
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
171
+ with :
172
+ files : |
173
+ ./**/*.whl
174
+ ./**/*.tar.gz
175
+ ./**/*.pdf
176
+ ./**/*.zip
0 commit comments