-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from daducci/release/v2.3.0
[RELEASE] v2.3.0
- Loading branch information
Showing
17 changed files
with
1,522 additions
and
2,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
name: Build wheels | ||
run-name: Build wheels - ${{ github.sha }} | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'release/**' | ||
jobs: | ||
build_windows_wheels: | ||
strategy: | ||
matrix: | ||
py: [cp38, cp39, cp310, cp311, cp312] | ||
arch: | ||
- [AMD64, win_amd64, x64, x64, 64bit] | ||
- [x86, win32, x86, Win32, 32bit] | ||
name: ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Compile pthread-win32 | ||
run: | | ||
Import-Module 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll' | ||
Enter-VsDevShell -VsInstallPath 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' -DevCmdArguments '-arch=x64' -StartInPath 'C:\' | ||
git clone https://github.com/GerHobbelt/pthread-win32.git | ||
cd C:\pthread-win32\windows\VS2022 | ||
msbuild .\pthread.2022.sln -t:pthread_static_lib -p:Configuration=Release,Platform=${{ matrix.arch[3] }} | ||
cd C:\ | ||
mkdir C:\pthread-win32_static_lib | ||
mkdir C:\pthread-win32_static_lib\include | ||
mkdir C:\pthread-win32_static_lib\lib | ||
cp C:\pthread-win32\windows\VS2022\bin\Release-Unicode-${{ matrix.arch[4] }}-${{ matrix.arch[2] }}\pthread_static_lib.lib C:\pthread-win32_static_lib\lib\pthread.lib | ||
cp C:\pthread-win32\_ptw32.h C:\pthread-win32_static_lib\include | ||
cp C:\pthread-win32\pthread.h C:\pthread-win32_static_lib\include | ||
cp C:\pthread-win32\sched.h C:\pthread-win32_static_lib\include | ||
cp C:\pthread-win32\semaphore.h C:\pthread-win32_static_lib\include | ||
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
uses: pypa/[email protected] | ||
env: | ||
PTHREAD_WIN_INCLUDE: C:\pthread-win32_static_lib\include | ||
PTHREAD_WIN_LIB: C:\pthread-win32_static_lib\lib | ||
CIBW_PLATFORM: windows | ||
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
CIBW_ARCHS_WINDOWS: ${{ matrix.arch[0] }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels_${{ matrix.py }}_${{ matrix.arch[1] }} | ||
path: ./wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
build_macos_wheels: | ||
strategy: | ||
matrix: | ||
config: | ||
[ | ||
{ | ||
py: cp38, | ||
arch: [x86_64, macosx_x86_64, 12.0, macos-12] | ||
}, | ||
{ | ||
py: cp39, | ||
arch: [x86_64, macosx_x86_64, 12.0, macos-12] | ||
}, | ||
{ | ||
py: cp310, | ||
arch: [x86_64, macosx_x86_64, 12.0, macos-12] | ||
}, | ||
{ | ||
py: cp311, | ||
arch: [x86_64, macosx_x86_64, 12.0, macos-12] | ||
}, | ||
{ | ||
py: cp312, | ||
arch: [x86_64, macosx_x86_64, 12.0, macos-12] | ||
}, | ||
{ | ||
py: cp38, | ||
arch: [arm64, macosx_arm64, 12.0, macos-14] | ||
}, | ||
{ | ||
py: cp39, | ||
arch: [arm64, macosx_arm64, 12.0, macos-14] | ||
}, | ||
{ | ||
py: cp310, | ||
arch: [arm64, macosx_arm64, 12.0, macos-14] | ||
}, | ||
{ | ||
py: cp311, | ||
arch: [arm64, macosx_arm64, 12.0, macos-14] | ||
}, | ||
{ | ||
py: cp312, | ||
arch: [arm64, macosx_arm64, 12.0, macos-14] | ||
} | ||
] | ||
name: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} | ||
runs-on: ${{ matrix.config.arch[3] }} | ||
if: | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pipx # NOTE: required only for arm64 | ||
if: startsWith(matrix.config.arch[0], 'arm64') | ||
run: | | ||
brew install pipx | ||
- name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} | ||
uses: pypa/[email protected] | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }} | ||
CIBW_PLATFORM: macos | ||
CIBW_BUILD: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }} | ||
CIBW_ARCHS_MACOS: ${{ matrix.config.arch[0] }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels_${{ matrix.config.py }}_${{ matrix.config.arch[1] }} | ||
path: ./wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
build_linux_wheels: | ||
strategy: | ||
matrix: | ||
py: [cp38, cp39, cp310, cp311, cp312] | ||
arch: | ||
- [x86_64, manylinux_x86_64, amd64] | ||
- [aarch64, manylinux_aarch64, arm64] | ||
name: ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
with: | ||
platforms: ${{ matrix.arch[2] }} | ||
|
||
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_PLATFORM: linux | ||
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }} | ||
CIBW_ARCHS_LINUX: ${{ matrix.arch[0] }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels_${{ matrix.py }}_${{ matrix.arch[1] }} | ||
path: ./wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
build_source_distribution: | ||
name: sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build source distribution | ||
run: | | ||
pip install -U pip | ||
pip install -U build | ||
python -m build --sdist | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sdist | ||
path: ./dist/*.tar.gz | ||
if-no-files-found: error | ||
|
||
run_id: | ||
name: Create/Update WHEELS_ARTIFACTS_RUN_ID secret | ||
runs-on: ubuntu-latest | ||
needs: [build_windows_wheels, build_macos_wheels, build_linux_wheels, build_source_distribution] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
gh secret set WHEELS_ARTIFACTS_RUN_ID --body ${{ github.run_id }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish on PyPI | ||
run-name: Publish on PyPI - ${{ github.sha }} | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
publish_on_pypi: | ||
name: Publish on PyPI | ||
if: github.event.release.prerelease == false | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/dmri-commit | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GH_PAT }} | ||
run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }} | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish on PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true | ||
verbose: true | ||
print-hash: true | ||
|
||
publish_on_pypi_test: | ||
name: Publish on PyPI Test | ||
if: github.event.release.prerelease == true && contains(github.event.release.tag_name, 'rc') | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/project/dmri-commit | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GH_PAT }} | ||
run-id: ${{ secrets.WHEELS_ARTIFACTS_RUN_ID }} | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish on PyPI Test | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
verbose: true | ||
print-hash: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.