From fe405b5af1b8c178f313a52b1b1d8caba3e00c4e Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 6 Oct 2021 14:44:49 +1000 Subject: [PATCH] Attempt to get Windows wheel working --- .github/workflows/build.yml | 371 +++++++++++++++++----------------- .github/workflows/release.yml | 212 +++++++++---------- ci/before-deploy.sh | 2 +- 3 files changed, 300 insertions(+), 285 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 522da633..9f8dbeac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,94 +6,93 @@ on: pull_request: null jobs: -# linux: -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# name: -# - debian-stable -# - debian-heimdal -# - centos-8 -# - fedora-latest -# include: -# - name: debian-stable -# distro: debian:stable -# - name: debian-heimdal -# distro: debian:stable -# krb5_ver: heimdal -# - name: centos-8 -# distro: centos:8 -# - name: fedora-latest -# distro: fedora:latest -# flake: 'yes' - -# steps: -# - name: Check out code -# uses: actions/checkout@v2 - -# - name: Build and test gssapi -# run: ./ci/run-on-linux.sh ./ci/build.sh -# env: -# DISTRO: ${{ matrix.distro }} -# KRB5_VER: ${{ matrix.krb5_ver }} -# FLAKE: ${{ matrix.flake }} - -# windows: -# runs-on: windows-latest -# strategy: -# fail-fast: false -# matrix: -# name: -# - win-py-3.10 -# - win-py-3.9 -# - win-py-3.8 -# - win-py-3.7 -# - win-py-3.6 -# arch: -# - x64 -# - x86 -# include: -# - name: win-py-3.10 -# pyenv: '3.10' -# - name: win-py-3.9 -# pyenv: '3.9' -# - name: win-py-3.8 -# pyenv: '3.8' -# - name: win-py-3.7 -# pyenv: '3.7' -# - name: win-py-3.6 -# pyenv: '3.6' - -# steps: -# - name: Check out code -# uses: actions/checkout@v2 - -# - name: Install the right python -# uses: actions/setup-python@v2 -# with: -# python-version: ${{ matrix.pyenv }} -# architecture: ${{ matrix.arch }} - -# - name: Build and test gssapi -# shell: bash -# run: ./ci/build.sh -# env: -# OS_NAME: windows - -# macos-heimdal: -# runs-on: macos-latest -# steps: -# - name: Check out code -# uses: actions/checkout@v2 - -# - name: Build and test gssapi -# run: ./ci/build.sh -# env: -# KRB5_VER: heimdal - - # FIXME: Remove once validated that it works - sdist: + # linux: + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # name: + # - debian-stable + # - debian-heimdal + # - centos-8 + # - fedora-latest + # include: + # - name: debian-stable + # distro: debian:stable + # - name: debian-heimdal + # distro: debian:stable + # krb5_ver: heimdal + # - name: centos-8 + # distro: centos:8 + # - name: fedora-latest + # distro: fedora:latest + # flake: 'yes' + + # steps: + # - name: Check out code + # uses: actions/checkout@v2 + + # - name: Build and test gssapi + # run: ./ci/run-on-linux.sh ./ci/build.sh + # env: + # DISTRO: ${{ matrix.distro }} + # KRB5_VER: ${{ matrix.krb5_ver }} + # FLAKE: ${{ matrix.flake }} + + # windows: + # runs-on: windows-latest + # strategy: + # fail-fast: false + # matrix: + # name: + # - win-py-3.10 + # - win-py-3.9 + # - win-py-3.8 + # - win-py-3.7 + # - win-py-3.6 + # arch: + # - x64 + # - x86 + # include: + # - name: win-py-3.10 + # pyenv: '3.10' + # - name: win-py-3.9 + # pyenv: '3.9' + # - name: win-py-3.8 + # pyenv: '3.8' + # - name: win-py-3.7 + # pyenv: '3.7' + # - name: win-py-3.6 + # pyenv: '3.6' + + # steps: + # - name: Check out code + # uses: actions/checkout@v2 + + # - name: Install the right python + # uses: actions/setup-python@v2 + # with: + # python-version: ${{ matrix.pyenv }} + # architecture: ${{ matrix.arch }} + + # - name: Build and test gssapi + # shell: bash + # run: ./ci/build.sh + # env: + # OS_NAME: windows + + # macos-heimdal: + # runs-on: macos-latest + # steps: + # - name: Check out code + # uses: actions/checkout@v2 + + # - name: Build and test gssapi + # run: ./ci/build.sh + # env: + # KRB5_VER: heimdal + + sdist-release: runs-on: ubuntu-latest steps: @@ -111,98 +110,110 @@ jobs: path: ./dist/*.tar.gz name: artifact - - name: Upload tagged build artifact - uses: actions/upload-artifact@v2 - with: - path: ./tag_build/* - name: tag_build - - wheel-windows: + # - name: Deploy stable docs + # uses: JamesIves/github-pages-deploy-action@3.7.1 + # with: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # BRANCH: gh-pages + # FOLDER: ci_docs_build/html + # TARGET_FOLDER: stable + + # - name: Create release + # uses: actions/create-release@v1 + # id: cr + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: ${{ github.ref }} + # release_name: ${{ github.ref }} + + # - id: tarball + # run: echo "::set-output name=tarball::`ls tag_build/*.tar.gz | awk -F/ '{print $2}'`" + + # - id: checksum + # run: echo "::set-output name=checksum::`ls tag_build/*.sha512sum | awk -F/ '{print $2}'`" + + # - name: Upload release tarball + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.cr.outputs.upload_url }} + # asset_path: tag_build/${{ steps.tarball.outputs.tarball }} + # asset_name: ${{ steps.tarball.outputs.tarball }} + # asset_content_type: application/octet-stream + + # - name: Upload release checksum + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.cr.outputs.upload_url }} + # asset_path: tag_build/${{ steps.checksum.outputs.checksum }} + # asset_name: ${{ steps.checksum.outputs.checksum }} + # asset_content_type: text/plain + + wheel: needs: - - sdist + - sdist-release - runs-on: windows-latest + runs-on: ${{ matrix.os }} strategy: matrix: - name: - - win-wheel-3.10 - - win-wheel-3.9 - - win-wheel-3.8 - - win-wheel-3.7 - - win-wheel-3.6 - arch: - - win_amd64 - - win32 include: - - name: win-wheel-3.10 - pyenv: cp310 - - name: win-wheel-3.9 - pyenv: cp39 - - name: win-wheel-3.8 - pyenv: cp38 - - name: win-wheel-3.7 - pyenv: cp37 - - name: win-wheel-3.6 - pyenv: cp36 + - os: macOS-10.15 + version: cp310-macosx_x86_64 + - os: macOS-10.15 + version: cp310-macosx_arm64 + - os: macOS-10.15 + version: cp39-macosx_x86_64 + - os: macOS-10.15 + version: cp39-macosx_arm64 + - os: macOS-10.15 + version: cp38-macosx_x86_64 + - os: macOS-10.15 + version: cp38-macosx_arm64 + - os: macOS-10.15 + version: cp37-macosx_x86_64 + - os: macOS-10.15 + version: cp36-macosx_x86_64 + + - os: windows-2019 + version: cp310-win_amd64 + - os: windows-2019 + version: cp310-win32 + - os: windows-2019 + version: cp39-win_amd64 + - os: windows-2019 + version: cp39-win32 + - os: windows-2019 + version: cp38-win_amd64 + - os: windows-2019 + version: cp38-win32 + - os: windows-2019 + version: cp37-win_amd64 + - os: windows-2019 + version: cp37-win32 + - os: windows-2019 + version: cp36-win_amd64 + - os: windows-2019 + version: cp36-win32 steps: - - name: Check out code - uses: actions/checkout@v2 - - name: Set up environment + if: startsWith(matrix.os, 'windows-') shell: bash - run: ./ci/build.sh - env: - OS_NAME: windows - - - name: Build wheel - uses: pypa/cibuildwheel@v2.1.2 - env: - CIBW_ARCHS: all - CIBW_BUILD: ${{ matrix.pyenv }}-${{ matrix.arch }} - CIBW_BUILD_VERBOSITY: 1 - - - name: Upload wheel - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - name: artifact - - wheel-macos: - needs: - - sdist + run: | + choco.exe install \ + --no-progress \ + --yes \ + --ignore-detected-reboot \ + --allow-downgrade \ + --install-arguments "'ADDLOCAL=ALL'" \ + ${{ endsWith(matrix.version, '-win32') && '--x86' || '' }} mitkerberos || true - runs-on: macos-10.15 + echo "C:\Program Files${{ endsWith(matrix.version, '-win32') && ' (x86)' || '' }}\MIT\Kerberos\bin;$PATH" >> $GITHUB_PATH - strategy: - matrix: - name: - - macos-wheel-3.10 - - macos-wheel-3.9 - - macos-wheel-3.8 - - macos-wheel-3.7 - - macos-wheel-3.6 - arch: - - x86_64 - - arm64 - include: - - name: macos-wheel-3.10 - pyenv: cp310 - - name: macos-wheel-3.9 - pyenv: cp39 - - name: macos-wheel-3.8 - pyenv: cp38 - - name: macos-wheel-3.7 - pyenv: cp37 - - name: macos-wheel-3.6 - pyenv: cp36 - exclude: - - name: macos-wheel-3.7 - arch: arm64 - - name: macos-wheel-3.6 - arch: arm64 - - steps: - name: Download sdist uses: actions/download-artifact@v2 with: @@ -210,6 +221,7 @@ jobs: path: ./ - name: Extract sdist + shell: bash run: | tar xf gssapi-*.tar.gz mv gssapi-*/* . @@ -221,7 +233,7 @@ jobs: env: CIBW_ARCHS: all CIBW_TEST_SKIP: '*_arm64' - CIBW_BUILD: ${{ matrix.pyenv }}-macosx_${{ matrix.arch }} + CIBW_BUILD: ${{ matrix.version }} CIBW_BUILD_VERBOSITY: 1 - name: Upload wheel @@ -230,10 +242,9 @@ jobs: path: ./wheelhouse/*.whl name: artifact - release: + pypi: needs: - - wheel-windows - - wheel-macos + - wheel runs-on: ubuntu-latest @@ -244,12 +255,10 @@ jobs: name: artifact path: ./dist - - name: Download tagged build artifact - uses: actions/download-artifact@v2 - with: - name: tag_build - path: ./tag_build + - run: ls -al dist - - run: | - ls -al ./dist - ls -al ./tag_build + # - name: Deploy to PyPI + # uses: pypa/gh-action-pypi-publish@v1.1.0 + # with: + # user: __token__ + # password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f770e311..da8b08ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,100 +4,7 @@ on: tags: v* jobs: - wheel-windows: - runs-on: windows-latest - strategy: - matrix: - name: - - win-wheel-3.10 - - win-wheel-3.9 - - win-wheel-3.8 - - win-wheel-3.7 - - win-wheel-3.6 - arch: - - win_amd64 - - win32 - include: - - name: win-wheel-3.10 - pyenv: cp310 - - name: win-wheel-3.9 - pyenv: cp39 - - name: win-wheel-3.8 - pyenv: cp38 - - name: win-wheel-3.7 - pyenv: cp37 - - name: win-wheel-3.6 - pyenv: cp36 - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: build wheel - uses: pypa/cibuildwheel@v2.1.2 - env: - CIBW_ARCHS: all - CIBW_BUILD: ${{ matrix.pyenv }}-${{ matrix.arch }} - CIBW_BUILD_VERBOSITY: 1 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - name: artifact - - wheel-macos: - runs-on: macos-10.15 - - strategy: - matrix: - name: - - macos-wheel-3.10 - - macos-wheel-3.9 - - macos-wheel-3.8 - - macos-wheel-3.7 - - macos-wheel-3.6 - arch: - - x86_64 - - arm64 - include: - - name: macos-wheel-3.10 - pyenv: cp310 - - name: macos-wheel-3.9 - pyenv: cp39 - - name: macos-wheel-3.8 - pyenv: cp38 - - name: macos-wheel-3.7 - pyenv: cp37 - - name: macos-wheel-3.6 - pyenv: cp36 - exclude: - - name: macos-wheel-3.7 - arch: arm64 - - name: macos-wheel-3.6 - arch: arm64 - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: build wheel - uses: pypa/cibuildwheel@v2.1.2 - env: - CIBW_ARCHS: all - CIBW_TEST_SKIP: '*_arm64' - CIBW_BUILD: ${{ matrix.pyenv }}-macosx_${{ matrix.arch }} - CIBW_BUILD_VERBOSITY: 1 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - name: artifact - - release-linux: - needs: - - wheel-windows - - wheel-macos - + sdist-release: runs-on: ubuntu-latest steps: @@ -109,17 +16,11 @@ jobs: env: DISTRO: fedora:latest - - name: Download wheels - uses: actions/download-artifact@v2 + - name: Upload sdist + uses: actions/upload-artifact@v2 with: + path: ./dist/*.tar.gz name: artifact - path: ./dist - - - name: Deploy to PyPI - uses: pypa/gh-action-pypi-publish@v1.1.0 - with: - user: __token__ - password: ${{ secrets.pypi_password }} - name: Deploy stable docs uses: JamesIves/github-pages-deploy-action@3.7.1 @@ -163,3 +64,108 @@ jobs: asset_path: tag_build/${{ steps.checksum.outputs.checksum }} asset_name: ${{ steps.checksum.outputs.checksum }} asset_content_type: text/plain + + wheel: + needs: + - sdist-release + + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: macOS-10.15 + version: cp310-macosx_x86_64 + - os: macOS-10.15 + version: cp310-macosx_arm64 + - os: macOS-10.15 + version: cp39-macosx_x86_64 + - os: macOS-10.15 + version: cp39-macosx_arm64 + - os: macOS-10.15 + version: cp38-macosx_x86_64 + - os: macOS-10.15 + version: cp38-macosx_arm64 + - os: macOS-10.15 + version: cp37-macosx_x86_64 + - os: macOS-10.15 + version: cp36-macosx_x86_64 + + - os: windows-2019 + version: cp310-win_amd64 + - os: windows-2019 + version: cp310-win32 + - os: windows-2019 + version: cp39-win_amd64 + - os: windows-2019 + version: cp39-win32 + - os: windows-2019 + version: cp38-win_amd64 + - os: windows-2019 + version: cp38-win32 + - os: windows-2019 + version: cp37-win_amd64 + - os: windows-2019 + version: cp37-win32 + - os: windows-2019 + version: cp36-win_amd64 + - os: windows-2019 + version: cp36-win32 + + steps: + - name: Set up environment + if: startsWith(matrix.os, 'windows-' + shell: bash + run: >- + choco.exe install --no-progress --yes --ignore-detected-reboot --allow-downgrade + --install-arguments "'ADDLOCAL=ALL'" + ${{ matrix.arch == 'win32' && '--x86' || '' }} + mitkerberos || true + + echo "C:\Program Files${{ matrix.arch == 'win32' && ' (x86)' || '' }}\MIT\Kerberos\bin;$PATH" >> $GITHUB_PATH + + - name: Download sdist + uses: actions/download-artifact@v2 + with: + name: artifact + path: ./ + + - name: Extract sdist + shell: bash + run: | + tar xf gssapi-*.tar.gz + mv gssapi-*/* . + rm -r gssapi-*/ + rm gssapi-*.tar.gz + + - name: Build wheel + uses: pypa/cibuildwheel@v2.1.2 + env: + CIBW_ARCHS: all + CIBW_TEST_SKIP: '*_arm64' + CIBW_BUILD: ${{ matrix.version }} + CIBW_BUILD_VERBOSITY: 1 + + - name: Upload wheel + uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + name: artifact + + pypi: + needs: + - wheel + + runs-on: ubuntu-latest + + steps: + - name: Download sdist and wheels + uses: actions/download-artifact@v2 + with: + name: artifact + path: ./dist + + - name: Deploy to PyPI + uses: pypa/gh-action-pypi-publish@v1.1.0 + with: + user: __token__ + password: ${{ secrets.pypi_password }} diff --git a/ci/before-deploy.sh b/ci/before-deploy.sh index 476cc111..ce92c92e 100755 --- a/ci/before-deploy.sh +++ b/ci/before-deploy.sh @@ -39,8 +39,8 @@ mkdir ./tag_build # create and checksum the tarball +tag=v1.7.1 #tag=$(git describe --tags) -tags="v1.2.3" if [ x"${tag#v[0-9]}" = "x${tag}" ]; then PYTHON_GSSAPI_VERSION=${tag} else