diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aee8bcc1..1e1f56e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,60 +59,65 @@ jobs: version=$(poetry version | awk '{ print $2 }') && poetry version $version.dev.$(date +%s) - # build_wheels_linux: - # name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest] - # cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] - # cibw_archs: ["x86_64"] - - # steps: - # - name: Check out repository - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - - # - name: Set up QEMU - # if: matrix.cibw_archs != 'x86_64' - # uses: docker/setup-qemu-action@v2 - # with: - # platforms: all - - # - name: Set up python 3.11 - # uses: actions/setup-python@v4 - # with: - # python-version: "3.11" - - # - name: Install poetry - # uses: snok/install-poetry@v1 - # with: - # virtualenvs-create: false - # virtualenvs-in-project: false - - # - name: Build wheels - # uses: pypa/cibuildwheel@v2.12.3 - # env: - # CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - # CIBW_ARCHS: ${{ matrix.cibw_archs }} - # CIBW_BUILD: ${{ matrix.cibw_build }} - # CIBW_SKIP: "*musllinux*" - - # - uses: actions/upload-artifact@v3 - # with: - # path: wheelhouse/*.whl + build_wheels_linux: + name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" + runs-on: ${{ matrix.os }} + needs: ["release"] + if: needs.release.check-version.outputs.tag + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] + cibw_archs: ["x86_64"] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up QEMU + if: matrix.cibw_archs != 'x86_64' + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Set up python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false + virtualenvs-in-project: false + + - name: Build wheels + uses: pypa/cibuildwheel@v2.12.3 + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*musllinux*" + + - uses: actions/upload-artifact@v3 + with: + path: wheelhouse/*.whl build_wheels_macos: name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" runs-on: ${{ matrix.os }} + needs: ["release"] + if: needs.release.check-version.outputs.tag + strategy: fail-fast: false matrix: os: [macos-latest] - # cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] - cibw_build: ["cp39-*"] + cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] cibw_archs: ["x86_64"] env: SYSTEM_VERSION_COMPAT: 0 # https://github.com/actions/setup-python/issues/469#issuecomment-1192522949 @@ -122,10 +127,10 @@ jobs: with: fetch-depth: 0 - - name: Set up python 3.12 + - name: Set up python 3.10 uses: actions/setup-python@v4 with: - python-version: "3.12" + python-version: "3.10" - name: Install poetry uses: snok/install-poetry@v1 @@ -161,11 +166,12 @@ jobs: build_wheels_macos_arm64: name: "${{ matrix.os }} ${{ matrix.cibw_archs }} ${{ matrix.cibw_build }}" runs-on: ${{ matrix.os }} + needs: ["release"] + if: needs.release.check-version.outputs.tag strategy: matrix: os: [macos-latest] - # cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] - cibw_build: ["cp39-*"] + cibw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*"] cibw_archs: ["arm64"] steps: @@ -176,7 +182,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.12" + python-version: "3.10" - name: Configure Homebrew uses: Homebrew/actions/setup-homebrew@master @@ -227,7 +233,6 @@ jobs: path: ./wheelhouse/*.whl upload_to_pypi: - # needs: ["release", "build_wheels_linux"] needs: ["release", "build_wheels_macos_arm64", "build_wheels_macos"] runs-on: ubuntu-latest steps: @@ -255,7 +260,7 @@ jobs: - name: Publish the release notes uses: release-drafter/release-drafter@v5.25.0 with: - publish: ${{ steps.check-version.outputs.tag != '' }} - tag: ${{ steps.check-version.outputs.tag }} + publish: ${{ needs.release.check-version.outputs.tag != '' }} + tag: ${{ needs.release.check-version.outputs.tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}