|
32 | 32 | release: |
33 | 33 | types: [published] |
34 | 34 |
|
35 | | - |
36 | | -env: |
37 | | - HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker |
38 | | - HOMEBREW_NO_AUTO_UPDATE: "ON" |
39 | | - HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" |
40 | | - HOMEBREW_NO_GITHUB_API: "ON" |
41 | | - HOMEBREW_NO_INSTALL_CLEANUP: "ON" |
42 | | - CIBW_SKIP: "pp* *i686*" # skip building for PyPy |
43 | | - CIBW_ARCHS_MACOS: x86_64 |
44 | | - CIBW_ARCHS_LINUX: x86_64 # ppc64le # uncomment to enable powerPC build |
45 | | - CIBW_ENVIRONMENT_MACOS: PATH="$(brew --prefix)/opt/make/libexec/gnubin:$PATH" |
46 | | - MACOSX_DEPLOYMENT_TARGET: "10.09" |
47 | | - |
48 | | - |
49 | 35 | jobs: |
50 | | - build_wheels: |
51 | | - name: Build wheels on ${{ matrix.os }} |
52 | | - runs-on: ${{ matrix.os }} |
53 | | - strategy: |
54 | | - fail-fast: false |
55 | | - matrix: |
56 | | - os: [ubuntu-22.04, macos-12] |
57 | | - |
| 36 | + build_dists: |
| 37 | + name: Build Distributions |
| 38 | + runs-on: ubuntu-22.04 |
58 | 39 | steps: |
59 | 40 | - uses: actions/checkout@v4 |
60 | 41 | - uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: '3.9' |
61 | 44 |
|
62 | | - - name: Install cibuildwheel |
63 | | - run: python -m pip install cibuildwheel>=2.12.3 |
| 45 | + - name: Install build |
| 46 | + run: python -m pip install 'build>=1.2.2,<2' |
64 | 47 |
|
65 | 48 | - name: Install build-essentials |
66 | | - if: contains(matrix.os, 'ubuntu') |
67 | 49 | run: | |
68 | 50 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
69 | 51 | sudo apt-get update |
70 | | - sudo apt-get install -y build-essential |
71 | | - sudo apt-get install -y wget |
72 | | -
|
73 | | - - name: Install GNU make for MacOS |
74 | | - if: contains(matrix.os, 'macos') |
75 | | - run: brew install make || true |
76 | | - |
77 | | - - name: list target wheels |
78 | | - run: | |
79 | | - python -m cibuildwheel . --print-build-identifiers |
80 | | -
|
81 | | - - name: Build wheels |
82 | | - run: python -m cibuildwheel --output-dir wheelhouse |
83 | | - env: |
84 | | - CIBW_ENVIRONMENT_MACOS: PATH="$(brew --prefix)/opt/make/libexec/gnubin:$PATH" |
85 | | - MACOSX_DEPLOYMENT_TARGET: "10.09" |
86 | | - |
87 | | - - uses: actions/upload-artifact@v3 |
88 | | - with: |
89 | | - path: ./wheelhouse/*.whl |
90 | | - |
91 | | - |
92 | | - build_sdist: |
93 | | - name: Build source distribution |
94 | | - runs-on: ubuntu-latest |
95 | | - steps: |
96 | | - - uses: actions/checkout@v4 |
| 52 | + sudo apt-get install -y build-essential wget |
97 | 53 |
|
98 | | - - uses: actions/setup-python@v5 |
99 | | - name: Install Python |
100 | | - with: |
101 | | - python-version: '3.9' |
102 | | - |
103 | | - - name: Build sdist |
104 | | - run: | |
105 | | - python -m pip install cmake>=3.13 |
106 | | - python setup.py sdist |
| 54 | + - name: Build Distributions |
| 55 | + run: python -m build . |
107 | 56 |
|
108 | 57 | - uses: actions/upload-artifact@v3 |
109 | 58 | with: |
110 | | - path: dist/*.tar.gz |
| 59 | + name: distributables |
| 60 | + path: ./dist/* |
111 | 61 |
|
112 | 62 |
|
113 | 63 | upload_pypi: |
114 | | - needs: [build_wheels, build_sdist] |
115 | | - runs-on: ubuntu-latest |
| 64 | + needs: [build_dists] |
| 65 | + runs-on: ubuntu-22.04 |
116 | 66 | steps: |
117 | 67 | - uses: actions/download-artifact@v3 |
118 | 68 | with: |
119 | | - name: artifact |
| 69 | + name: distributables |
120 | 70 | path: dist |
121 | 71 |
|
122 | 72 | - uses: pypa/gh-action-pypi-publish@release/v1 |
123 | 73 | with: |
124 | 74 | user: __token__ |
125 | 75 | password: ${{ secrets.PYPI }} |
126 | | - #repository_url: https://test.pypi.org/legacy/ |
127 | | - |
| 76 | + # repository-url: https://test.pypi.org/legacy/ |
128 | 77 |
|
129 | 78 | createPullRequest: |
130 | | - runs-on: ubuntu-latest |
| 79 | + needs: [upload_pypi] |
| 80 | + runs-on: ubuntu-22.04 |
131 | 81 | steps: |
132 | 82 | - name: Checkout code |
133 | 83 | uses: actions/checkout@v4 |
134 | 84 |
|
135 | 85 | - name: Create pull request |
136 | 86 | run: | |
137 | | - gh pr create -B develop -H master --title 'Merge master into develop' --body 'This PR brings develop up to date with master for release.' |
| 87 | + gh pr create -B develop \ |
| 88 | + -H master \ |
| 89 | + --title 'Merge master into develop' \ |
| 90 | + --body 'This PR brings develop up to date with master for release.' |
138 | 91 | env: |
139 | 92 | GH_TOKEN: ${{ github.token }} |
0 commit comments