@@ -41,43 +41,86 @@ jobs:
4141 strategy :
4242 matrix :
4343 cfg :
44- - { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', platform: 'manylinux_2_35_x86_64', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
45- - { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', platform: 'macosx_11_0_x86_64 ', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
46- - { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', platform: 'macosx_12_0_x86_64 ', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
47- - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', platform: 'macosx_13_0_x86_64 ', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
48- - { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', platform: 'macosx_12_0_arm64 ', cc: clang, cxx: clang++,
49- config : --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_12_0_arm64 }
50- - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', platform: 'macosx_13_0_arm64', cc: clang, cxx: clang++,
44+ - { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld }
45+ # - { name: 'MacOS 11 x86_64 LLVM+libc++', os: 'macos-11', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
46+ # - { name: 'MacOS 12 x86_64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
47+ # - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos }
48+ # - { name: 'MacOS 12 ARM64 LLVM+libc++', os: 'macos-12', cc: clang, cxx: clang++,
49+ # config: --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_12_0_arm64 }
50+ - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++,
5151 config : --config=libc++ --config=macos_arm64 --repo_env=PY_PLATFORM_OVERRIDE=macosx_13_0_arm64 }
52- py :
53- - { version: '3.8', interp: 'cp38', abi: 'cp38' }
54- - { version: '3.9', interp: 'cp39', abi: 'cp39' }
55- - { version: '3.10', interp: 'cp310', abi: 'cp310' }
56- - { version: '3.11', interp: 'cp311', abi: 'cp311' }
52+ python-version :
53+ # - '3.8'
54+ - ' 3.9'
55+ - ' 3.10'
56+ # - '3.11'
5757
5858 env :
5959 CC : ${{ matrix.cfg.cc }}
6060 CXX : ${{ matrix.cfg.cxx }}
61+ WHEEL_NAME : ' '
6162
6263 steps :
6364 - uses : actions/checkout@v3
6465
6566 - uses : actions/setup-python@v3
6667 with :
67- python-version : ${{ matrix.py. version }}
68+ python-version : ${{ matrix.python- version }}
6869
6970 - name : Install Python Dependencies
7071 run : pip3 install --upgrade pip packaging
7172
72- - name : Build for Python ${{ matrix.py. version }}
73+ - name : Build for Python ${{ matrix.python- version }}
7374 run : bazel --bazelrc=.bazelrc build --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel
7475
76+ - name : Get built wheel name
77+ working-directory : bazel-bin/dmlab2d
78+ run : |
79+ WHEEL_NAME="$(ls *.whl)"
80+ echo WHEEL_NAME="${WHEEL_NAME}" >> "${GITHUB_ENV}"
81+
7582 - name : Upload Release Asset
7683 uses : actions/upload-release-asset@v1
7784 env :
7885 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7986 with :
8087 upload_url : ${{ needs.create-release.outputs.upload-url }}
81- asset_path : bazel-bin/dmlab2d/dmlab2d-1.0- ${{ matrix.py.interp }}-${{ matrix.py.abi }}-${{ matrix.cfg.platform }}.whl
82- asset_name : dmlab2d-1.0- ${{ matrix.py.interp }}-${{ matrix.py.abi }}-${{ matrix.cfg.platform }}.whl
88+ asset_path : bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
89+ asset_name : ${{ env.WHEEL_NAME }}
8390 asset_content_type : application/zip
91+
92+ - name : Check wheel contents
93+ run : |
94+ pip install --upgrade check-wheel-contents
95+ check-wheel-contents bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
96+
97+ - name : Upload wheel as artifact
98+ uses : actions/upload-artifact@v3
99+ with :
100+ name : dist
101+ path : bazel-bin/dmlab2d/${{ env.WHEEL_NAME }}
102+ retention-days : 1
103+
104+ upload-wheel-to-pypi :
105+ name : Upload wheel to Pypi
106+ runs-on : ubuntu-latest
107+ needs : build-wheel
108+ timeout-minutes : 30
109+
110+ steps :
111+ - name : Download all wheels
112+ uses : actions/download-artifact@v3
113+
114+ - name : Publish package to TestPyPI
115+ uses : pypa/gh-action-pypi-publish@release/v1
116+ with :
117+ password : ${{ secrets.TESTPYPI_API_TOKEN }}
118+ packages-dir : dist
119+ repository-url : https://test.pypi.org/legacy/
120+
121+ - name : Publish package to PyPI
122+ if : startsWith(github.ref, 'refs/tags')
123+ uses : pypa/gh-action-pypi-publish@release/v1
124+ with :
125+ password : ${{ secrets.PYPI_API_TOKEN }}
126+ packages-dir : dist
0 commit comments