diff --git a/.github/workflows/build_deploy_wheels.yml b/.github/workflows/build_deploy_wheels.yml index 5369617f..3d63615d 100644 --- a/.github/workflows/build_deploy_wheels.yml +++ b/.github/workflows/build_deploy_wheels.yml @@ -5,10 +5,12 @@ on: branches: - main - develop + tags: + - "**" jobs: - deploy_wheels: + build_wheels: runs-on: ${{ matrix.buildplat[0] }} strategy: # Ensure that a wheel builder finishes even if another fails @@ -75,15 +77,31 @@ jobs: CIBW_BEFORE_BUILD_MACOS: bash {project}/build_tools/cibw_before_build_macos_arm.sh && meson setup --cross-file={project}/build_tools/x86_64-w64-arm64.ini build CIBW_CONFIG_SETTINGS_MACOS: builddir=build - - name: Publish wheels to PyPI - if: startsWith(github.ref, 'refs/tags') - env: - TWINE_USERNAME: '__token__' - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - twine upload dist/*.whl --skip-existing - - uses: actions/upload-artifact@v3 with: name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} - path: ./wheelhouse/*.whl \ No newline at end of file + path: ./wheelhouse/*.whl + + upload_wheels: + needs: build_wheels + runs-on: ubuntu-latest + + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: wheelhouse + + - name: Move wheels to dist directory + run: | + mkdir dist + cp wheelhouse/**/*.whl dist + ls dist/ + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} + packages_dir: dist/ + skip_existing: true \ No newline at end of file