@@ -32,38 +32,56 @@ jobs:
3232 # name: wheels
3333 # path: dist
3434
35- # windows:
36- # runs-on: windows-latest
37- # strategy:
38- # matrix:
39- # target: [x64]
40- # steps:
41- # - uses: actions/checkout@v3
42- # with:
43- # submodules: 'true'
44-
45- # - uses: actions/setup-python@v4
46- # with:
47- # python-version: '3.10'
48- # architecture: ${{ matrix.target }}
49-
50- # - name: Build wheels
51- # uses: PyO3/maturin-action@v1
52- # with:
53- # target: ${{ matrix.target }}
54- # args: --release --out dist --find-interpreter
55- # sccache: 'true'
35+ windows :
36+ # Skip building pull requests from the same repository
37+ if : ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
38+ runs-on : windows-latest
39+ env :
40+ # Disable output buffering in an attempt to get readable errors
41+ PYTHONUNBUFFERED : ' 1'
42+ steps :
43+ - name : Checkout
44+ uses : actions/checkout@v3
45+ with :
46+ submodules : ' true'
5647
57- # - name: Upload wheels
58- # uses: actions/upload-artifact@v3
59- # with:
60- # name: wheels
61- # path: dist
48+ - name : Python environment
49+ uses : actions/setup-python@v4
50+ with :
51+ python-version : ' 3.10'
52+
53+ - name : Install Rust toolchain
54+ uses : dtolnay/rust-toolchain@stable
55+ with :
56+ targets : x86_64-pc-windows-msvc
57+
58+ - name : Build
59+ shell : bash
60+ run : |
61+ pip install -r requirements.txt
62+ python setup.py bdist_wheel --py-limited-api=cp37
63+ pip install --force-reinstall dist/*.whl
64+ python -c "import icicle"
65+
66+ - name : Test
67+ run : |
68+ pip install -r tests/requirements.txt
69+ python tests/example.py
70+ python tests/invalid.py
71+
72+ - name : Upload wheels
73+ uses : actions/upload-artifact@v3
74+ with :
75+ name : wheels
76+ path : dist
6277
6378 macos :
6479 # Skip building pull requests from the same repository
6580 if : ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
6681 runs-on : macos-latest
82+ env :
83+ # Disable output buffering in an attempt to get readable errors
84+ PYTHONUNBUFFERED : ' 1'
6785 steps :
6886 - name : Checkout
6987 uses : actions/checkout@v3
@@ -105,20 +123,35 @@ jobs:
105123 name : wheels
106124 path : dist
107125
126+ release :
127+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
128+ runs-on : ubuntu-latest
129+ needs :
130+ - windows
131+ - macos
132+ # - linux
133+ steps :
134+ - uses : actions/download-artifact@v3
135+ with :
136+ name : wheels
108137
109- # release:
110- # name: Release
111- # runs-on: ubuntu-latest
112- # if: "startsWith(github.ref, 'refs/tags/')"
113- # needs: [linux, windows, macos]
114- # steps:
115- # - uses: actions/download-artifact@v3
116- # with:
117- # name: wheels
118- # - name: Publish to PyPI
119- # uses: PyO3/maturin-action@v1
120- # env:
121- # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
122- # with:
123- # command: upload
124- # args: --skip-existing *
138+ - name : Python environment
139+ uses : actions/setup-python@v4
140+ with :
141+ python-version : ' 3.10'
142+
143+ - name : Package
144+ run : |
145+ python setup.py sdist
146+
147+ - name : Publish to PyPI
148+ uses : pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
149+ with :
150+ password : ${{ secrets.PYPI_API_TOKEN }}
151+
152+ - name : Release
153+ uses : softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d # master 2023-03-26
154+ with :
155+ generate_release_notes : true
156+ env :
157+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments