File tree Expand file tree Collapse file tree 1 file changed +74
-0
lines changed
Expand file tree Collapse file tree 1 file changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+ on :
3+ push :
4+ tags :
5+ - v*
6+ branches :
7+ - v*
8+
9+ env :
10+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN_DIST }}
11+
12+ jobs :
13+ build :
14+ name : build release
15+ # only run on push to main and on release
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : set up python
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : " 3.13"
24+
25+ - run : pip install -U twine
26+ - run : make build-release
27+
28+ test_release :
29+ runs-on : ubuntu-latest
30+ name : Test release
31+ needs : [build]
32+ steps :
33+ - uses : actions/checkout@v4
34+
35+ - name : set up python
36+ uses : actions/setup-python@v5
37+ with :
38+ python-version : " 3.13"
39+
40+ - run : pip install dist/*.whl
41+ - run : python -c "from transformers import pipeline; classifier = pipeline('text-classification'); assert classifier('What a nice release')[0]['score'] > 0"
42+ - run : python -c "from transformers import *"
43+
44+ upload_package :
45+ if : startsWith(github.ref, 'refs/tags/')
46+ runs-on : ubuntu-latest
47+ steps :
48+ - run : echo "Should only run on tags"
49+
50+
51+ # upload_package:
52+ # name: Upload package to PyPi
53+ # runs-on: ubuntu-latest
54+ # needs: [build]
55+ #
56+ # steps:
57+ # - uses: actions/checkout@v4
58+ #
59+ # - name: Install Python
60+ # uses: actions/setup-python@v5
61+ # with:
62+ # python-version: "3.13"
63+ # architecture: x64
64+ #
65+ # - uses: actions/download-artifact@v4
66+ # with:
67+ # path: ./bindings/python/dist
68+ # merge-multiple: true
69+ # # Temporary deactivation while testing abi3 CI
70+ # # - name: Upload to PyPi
71+ # # working-directory: ./bindings/python
72+ # # run: |
73+ # # pip install twine
74+ # # twine upload dist/* -u __token__ -p "$PYPI_TOKEN"
You can’t perform that action at this time.
0 commit comments