44 push :
55 branches :
66 - main
7+ - jrp/ci-cd-fixes
78
89jobs :
910
@@ -14,16 +15,16 @@ jobs:
1415 fail-fast : false
1516 matrix :
1617 os : [ubuntu-latest, macos-latest]
17- python-version : [3.8 ]
18+ python-version : [3.12 ]
1819
1920 steps :
2021 - name : Checkout code
21- uses : nschloe/action-cached-lfs-checkout@v1.1 .3
22+ uses : nschloe/action-cached-lfs-checkout@v1.2 .3
2223 with :
23- exclude : " batbot/*/models/pytorch/ "
24+ exclude : " examples/example[2-4].wav "
2425
25- - uses : actions/setup- python@v2
26- name : Install Python
26+ - name : Set up Python ${{ matrix. python-version }}
27+ uses : actions/setup-python@v6
2728 with :
2829 python-version : ${{ matrix.python-version }}
2930
@@ -33,81 +34,93 @@ jobs:
3334 pip install build
3435 python -m build --wheel --outdir dist/ .
3536
36- - uses : actions/upload-artifact@v2
37+ - uses : actions/upload-artifact@v6
3738 with :
39+ name : artifact-wheel-${{ matrix.os }}-${{ matrix.python-version }}
3840 path : ./dist/*.whl
3941
4042 build_sdist :
4143 name : Build source distribution
4244 runs-on : ubuntu-latest
4345 steps :
4446 - name : Checkout code
45- uses : nschloe/action-cached-lfs-checkout@v1.1 .3
47+ uses : nschloe/action-cached-lfs-checkout@v1.2 .3
4648 with :
47- exclude : " batbot/*/models/pytorch/ "
49+ exclude : " examples/example[2-4].wav "
4850
49- - uses : actions/setup-python@v2
50- name : Install Python
51+ - name : Set up Python 3.12
52+ uses : actions/setup-python@v6
5153 with :
52- python-version : ' 3.8 '
54+ python-version : ' 3.12 '
5355
5456 - name : Build sdist
5557 run : |
5658 pip install --upgrade pip
5759 pip install build
5860 python -m build --sdist --outdir dist/ .
5961
60- - uses : actions/upload-artifact@v2
62+ - uses : actions/upload-artifact@v6
6163 with :
64+ name : artifact-sdist
6265 path : ./dist/*.tar.gz
6366
6467 test_wheel :
6568 needs : [build_wheels, build_sdist]
6669 runs-on : ubuntu-latest
67- env :
68- CLASSIFIER_BATCH_SIZE : 16
6970
7071 # test wheel
7172 if : github.event_name == 'push'
7273 steps :
73- - uses : actions/setup-python@v2
74- name : Install Python
74+ - name : Set up Python 3.12
75+ uses : actions/setup-python@v6
7576 with :
76- python-version : ' 3.8 '
77+ python-version : ' 3.12 '
7778
78- - uses : actions/download-artifact@v2
79+ - uses : actions/download-artifact@v7
7980 with :
80- name : artifact
81- path : dist
81+ path : artifact
8282
8383 - name : Install wheel
8484 run : |
8585 pip install --upgrade pip
8686 pip install wheel
87+ find .
88+ mkdir dist
89+ cp artifact/*-ubuntu-*/*.whl dist/
90+ cp artifact/*/*.tar.gz dist/
8791 pip install dist/*.whl
8892
8993 - name : Test module
9094 run : |
91- python -c "import batbot; batbot.fetch(); batbot.example(); "
95+ python -c "import batbot;"
9296
93- - name : Test CLI
94- run : |
95- batbot fetch
96- batbot example
97+ # - name: Test CLI
98+ # run: |
99+ # batbot example
97100
98101 upload_pypi :
99102 needs : [test_wheel]
100103 runs-on : ubuntu-latest
101104 # upload to PyPI on every tag starting with 'v'
102105 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
106+ environment :
107+ name : pypi
108+ url : https://pypi.org/p/batbot
109+ permissions :
110+ id-token : write
103111 steps :
104- - uses : actions/download-artifact@v2
112+ - uses : actions/download-artifact@v7
105113 with :
106- name : artifact
107- path : dist
114+ path : artifact
115+
116+ - name : Install wheel
117+ run : |
118+ find .
119+ mkdir dist
120+ cp artifact/*-ubuntu-*/*.whl dist/
121+ cp artifact/*/*.tar.gz dist/
108122
109- - uses : pypa/gh-action-pypi-publish@release/v1
123+ - name : Publish package distributions to PyPI
124+ uses : pypa/gh-action-pypi-publish@release/v1
110125 with :
111- user : __token__
112- password : ${{ secrets.PYPI_PASSWORD }}
113- # To test: repository_url: https://test.pypi.org/legacy/
126+ password : ${{ secrets.BATBOT_PYPI_TOKEN }}
0 commit comments