diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c040fa83 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,114 @@ +{ + "name": "Build", + "on": { + "push": { + "branches-ignore": "gh-pages", + "tags-ignore": "*", + }, + "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.8", "win-py-3.7", "win-py-3.6"], + "include": [ + { + "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 }}" }, + }, + { + "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" }, + }, + ], + }, + }, +} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..43db4c10 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,30 @@ +{ + "name": "Deploy docs", + "on": { "push": { "branches": "master" }}, + "jobs": { + "update-pages": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "name": "Check out code", + "uses": "actions/checkout@v2", + }, + { + "name": "Build docs", + "run": "./ci/run-on-linux-sh ./ci/before-docs-deploy.sh", + "env": { "DISTRO": "fedora:latest" }, + }, + { + "name": "Deploy latest docs", + "uses": "JamesIves/github-pages-deploy-action@releases/v3", + "with": { + "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}", + "BRANCH": "gh-pages", + "FOLDER": "ci_docs_build/html", + "TARGET_FOLDER": "latest", + }, + }, + ], + }, + }, +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bf0a7a40 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,111 @@ +{ + "name": "Release", + "on": { "push": { "tags": "v*" }}, + "jobs": { + "release-linux": { + "runs-on": "ubuntu-latest", + "steps": [ + { + "name": "Check out code", + "uses": "actions/checkout@v2", + }, + { + "name": "Set things up", + "run": "./ci/run-on-linux.sh ./ci/before-deploy.sh", + "env": { "DISTRO": "fedora:latest" }, + }, + { + "name": "Deploy to PyPI", + "uses": "pypa/gh-action-pypi-publish@v1.1.0", + "with": { + "user": "rharwood", + "password": "${{ secrets.pypi_password }}", + }, + }, + { + "name": "Deploy stable docs", + "uses": "JamesIves/github-pages-deploy-action@releases/v3", + "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 }}", + }, + }, + { + "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/*.tar.gz", + }, + }, + { + "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/*.sha*", + }, + }, + ], + }, + + "release-windows": { + "runs-on": "windows-latest", + "strategy": { + "matrix": { + "name": ["win-wheel-3.8", "win-wheel-3.7", + "win-wheel-3.6"], + "include": [ + { + "name": "win-wheel-3.8", + "pyenv": "3.8", + }, + { + "name": "win-wheel-3.7", + "pyenv": "3.7", + }, + { + "name": "win-wheel-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 }}" }, + }, + { + "name": "Create and upload Windows wheel", + "shell": "bash", + "run": "./ci/release-win.sh", + "env": { + "OS_NAME": "windows", + "TWINE_USER": "rharwood", + "TWINE_PASSWORD": "${{ secrets.pypi_password }}", + }, + }, + ], + }, + }, +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 99694d75..00000000 --- a/.travis.yml +++ /dev/null @@ -1,141 +0,0 @@ -sudo: required - -# not necessary, but less confusing if defined -language: python - -services: - - docker - -# we do everything in docker for non MacOS, MacOS setup is in .travis/build.sh -install: skip -before_install: skip - -stages: -- test -- name: deploy latest docs - if: (branch = master OR branch =~ ^infra/$) AND type = push -- name: deploy - if: tag is PRESENT - -script: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts; - sudo hostname test.box; - source ./.travis/lib-util.sh; - util::docker-run $DISTRO ./.travis/build.sh; - fi -- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.travis/build.sh; fi - -jobs: - # need to explictly define each builder for test due to different os types - include: - - stage: test - env: DISTRO=debian:stable PYTHON="3" # 3.7 - - - stage: test - env: DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal" - - # el7 doesn't do python3 modules, and epel7's python3-gssapi is patched - - stage: test - env: DISTRO=centos:8 PYTHON="3" - - - stage: test - env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" - - # Travis defaults to 10.13 (i.e., not latest), so specify osx_image - - &osx_test - stage: test - env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3" - os: osx - osx_image: xcode9.2 - language: generic # causes issues with pyenv installer when set to python - - - &win_test - stage: test - env: PYTHON="3" PYENV="3.8.1" - os: windows - language: sh # Windows not supported yet - - - <<: *win_test - env: PYTHON="3" PYENV="3.7.3" - - - <<: *win_test - env: PYTHON="3" PYENV="3.6.8" - - - stage: deploy latest docs - script: skip - env: - - DISTRO=fedora:latest - - PYTHON="3" - - secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos= - before_deploy: - - source ./.travis/lib-util.sh - - util::docker-run $DISTRO ./.travis/before-docs-deploy.sh - - deploy: - - provider: script - script: .travis/docs-deploy.sh travis_docs_build/html latest pythongssapi/python-gssapi - skip_cleanup: true - on: - all_branches: true - - - stage: deploy - script: skip - env: - - DISTRO=fedora:latest - - PYTHON="3" - - secure: L5SpEj5+no20PWwC9Y/XNhAfmUvYiuykwSMa/YyqvUuBjdizzpZcHr7Ego5nMdM1TniTxj4pSTM+GbM0FHCzNmAINSRh9g/D3hheRqlRBacqR0XwC9ZZRvkKvtzwnLh4vYWiauq4AoDeR5U6tkEcay6LjE57iMQcLjcKYBc+Eos= - before_deploy: - - source ./.travis/lib-util.sh - - util::docker-run $DISTRO ./.travis/before-deploy.sh - - ls -alR `pwd` - - deploy: - - provider: releases - api_key: - secure: fAaSSSjd/nUrIpINBjAT590pGF2nGq3I8ee6aGq6IAFpXoa/9eeN5eyOrE4MYucWCwYcH28c7510n35vuZQQor+UZIDo6l0K5M64/NZE1cZ43zOMjw3yHlrsJG+ohPS7YvjqD8GaFlLhF6ZvWvrPmWeijvs8qAT1eL7QoEG0xBk= - file_glob: true - file: - - tag_build/* - skip_cleanup: true - on: - all_branches: true - - - provider: pypi - user: rharwood - password: - secure: "hN861mjtLeC8IysypC6Pqzlazq29I+c69XGjbUR53izYQ90cz2F+B2azVTl9Su9NbXzdsGnhWZrjY1jtYMPIZE15xDaC8vs61QijFClqmyuKNRVzCt1w/sj21hyLXnYIrkAo4e3bswPF+hRGNwfb+rVrR/dqUwd1wyjZBBYMcQE=" - skip_cleanup: true - docs_dir: travis_docs_build/html - on: - all_branches: true - # NB(directxman12): this is a hack. Check ./.travis/before-deploy.sh for an explanation. - distributions: "check" - - - provider: script - script: .travis/docs-deploy.sh travis_docs_build/html stable pythongssapi/python-gssapi - skip_cleanup: true - on: - all_branches: true - - - &win_deploy - stage: deploy - os: windows - script: # This is egregious hacks around Travis - - ./.travis/before-deploy-windows-wheels.sh - - ./.travis/deploy-win.sh - env: - - PYTHON="3" - - PYENV="3.8.1" - language: sh # Travis doesn't support python here - - - <<: *win_deploy - env: - - PYTHON="3" - - PYENV="3.7.3" - - - <<: *win_deploy - env: - - PYTHON="3" - - PYENV="3.6.8" - diff --git a/.travis/before-deploy-windows-wheels.sh b/.travis/before-deploy-windows-wheels.sh deleted file mode 100644 index 000d62a5..00000000 --- a/.travis/before-deploy-windows-wheels.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -ex - -# See before-deploy.sh for anything unexplained - -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh - -./.travis/build.sh - -# Sigh, go find paths again -PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" -export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" - -# build the wheel -python -m pip install wheel -python setup.py bdist_wheel - -cd dist - -# Rename and checksum the wheel -if [ x"${TRAVIS_TAG#v[0-9]}" = "x${TRAVIS_TAG}" ]; then - PYTHON_GSSAPI_VERSION=${TRAVIS_TAG} -else - PYTHON_GSSAPI_VERSION=${TRAVIS_TAG#v} -fi - -PKG_NAME_VER=$(ls *.whl | sed "s/gssapi-[^-]*-\(.*\)\.whl/python-gssapi-${PYTHON_GSSAPI_VERSION}-\1/") - -cp *.whl "${PKG_NAME_VER}.whl" - -sha512sum --binary ./${PKG_NAME_VER}.whl > ./${PKG_NAME_VER}.sha512sum - -cd .. diff --git a/.travis/before-docs-deploy.sh b/.travis/before-docs-deploy.sh deleted file mode 100644 index 6860771a..00000000 --- a/.travis/before-docs-deploy.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ex - -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh - -# build again since I can't figure out how to get travis to recognize the old -# build in the new container. The other alternative (besides actually solving -# the issue) is to run the docs build and tarball generation every time. - -./.travis/build.sh - -setup::activate - -deploy::build-docs diff --git a/.travis/deploy-win.sh b/.travis/deploy-win.sh deleted file mode 100755 index b66b56d8..00000000 --- a/.travis/deploy-win.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -e - -# Temporary hack while issue DPL issue persists -# Manually upload wheels via twine for windows -# https://github.com/travis-ci/dpl/issues/1009 - -success="yes" - -# Sigh, go find paths again -PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" -export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" - -echo 'Running: python -m pip install twine ...' -python -m pip install twine - -echo 'Running: set +x; python -m twine upload...' -# Please note this cannot be set -x or passwords will leak! -set +x - -python -m twine upload -u $TWINE_USER -p $TWINE_PASSWORD dist/gssapi* > out.log 2>&1 || true - -# and restore... -set -x -egrep -i 'fail|error' out.log && cat out.log && exit 1 - -exit 0 diff --git a/.travis/docs-deploy.sh b/.travis/docs-deploy.sh deleted file mode 100755 index 998dd553..00000000 --- a/.travis/docs-deploy.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -ex - -# NB (very important): BE VERY CAREFUL WITH `set -x` FOR THIS FILE. -# The GitHub token is sensitive information, and should never -# be displayed on in the clear. - -source_directory=${1?need []} -target_directory=${2?need []} -target_repo=${3?need []} -target_branch=${4:-gh-pages} - -desc=$(git describe --tags) - -scratch_dir=$(mktemp -d) - -set +x # IMPORTANT -echo "cloning https://@github.com/${target_repo}.git#${target_branch} in to ${scratch_dir}/docs..." -git clone https://${GITHUB_TOKEN}@github.com/${target_repo}.git ${scratch_dir}/docs -b ${target_branch} -set -x - -mkdir -p ${scratch_dir}/docs/${target_directory} -cp -r ${source_directory}/. ${scratch_dir}/docs/${target_directory} -echo $desc > ${scratch_dir}/docs/${target_directory}/.from -pushd $scratch_dir/docs -git config user.email "deploy@travis-ci.org" -git config user.name "Deployment Bot (from Travis CI)" - -if [[ $(git status --porcelain | wc -l) -eq 0 ]]; then - echo "no docs changes in the latest commit" - exit 0 -fi - -git add ${target_directory} -git commit -m "Update ${target_directory} docs in based on ${desc}" - -set +x # IMPORTANT -echo "pushing to https://@github.com/${target_repo}.git#${target_branch}" -git push --quiet --force-with-lease origin ${target_branch}:${target_branch} -set -x - -popd -rm -rf ${scratch_dir} -echo "done!" diff --git a/.travis/lib-util.sh b/.travis/lib-util.sh deleted file mode 100644 index 1e0636d1..00000000 --- a/.travis/lib-util.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -util::docker-run() { - local distro=$1 - shift - - docker run \ - -v `pwd`:/tmp/build \ - -w /tmp/build \ - -e TRAVIS_TAG=$TRAVIS_TAG \ - -e PKG_NAME_VER=$PKG_NAME_VER \ - -e KRB5_VER=$KRB5_VER \ - -e PYTHON=$PYTHON \ - -e FLAKE=$FLAKE \ - $distro \ - /bin/bash -ex $@ -} diff --git a/README.txt b/README.txt index 1035210f..b0b68a65 100644 --- a/README.txt +++ b/README.txt @@ -8,9 +8,6 @@ Python-GSSAPI .. role:: bash(code) :language: bash -.. image:: https://travis-ci.org/pythongssapi/python-gssapi.svg?branch=master - :target: https://travis-ci.org/pythongssapi/python-gssapi - .. image:: https://badge.fury.io/gh/pythongssapi%2Fpython-gssapi.svg :target: http://badge.fury.io/gh/pythongssapi%2Fpython-gssapi diff --git a/.travis/before-deploy.sh b/ci/before-deploy.sh similarity index 65% rename from .travis/before-deploy.sh rename to ci/before-deploy.sh index 91e198b9..1f86b7d1 100755 --- a/.travis/before-deploy.sh +++ b/ci/before-deploy.sh @@ -1,13 +1,9 @@ #!/bin/bash -ex -source ./.travis/lib-setup.sh -source ./.travis/lib-deploy.sh +source ./ci/lib-setup.sh +source ./ci/lib-deploy.sh -# build again since I can't figure out how to get travis to recognize the old -# build in the new container. The other alternative (besides actually solving -# the issue) is to run the docs build and tarball generation every time. - -./.travis/build.sh +./ci/build.sh setup::activate @@ -17,8 +13,7 @@ yum -y install tar git deploy::build-docs # NB(directxman12): this is a *terrible* hack, but basically, -# dpl (the Travis deployer) uses `twine` instead of `setup.py sdist upload`. -# like this: +# `twine` gets called like this: # - python setup.py $PYPI_DISTRIBUTIONS # - twine upload -r pypi dist/* # - [some other stuff] @@ -44,10 +39,11 @@ mkdir ./tag_build # create and checksum the tarball -if [ x"${TRAVIS_TAG#v[0-9]}" = "x${TRAVIS_TAG}" ]; then - PYTHON_GSSAPI_VERSION=${TRAVIS_TAG} +tag=$(git describe --tags) +if [ x"${tag#v[0-9]}" = "x${tag}" ]; then + PYTHON_GSSAPI_VERSION=${tag} else - PYTHON_GSSAPI_VERSION=${TRAVIS_TAG#v} + PYTHON_GSSAPI_VERSION=${tag#v} fi PKG_NAME_VER="python-gssapi-${PYTHON_GSSAPI_VERSION}" diff --git a/ci/before-docs-deploy.sh b/ci/before-docs-deploy.sh new file mode 100644 index 00000000..a6bb1eb1 --- /dev/null +++ b/ci/before-docs-deploy.sh @@ -0,0 +1,12 @@ +#!/bin/bash -ex + +source ./ci/lib-setup.sh +source ./ci/lib-deploy.sh + +# GitHub Actions doesn't have a good concept of connected pipelines here, so +# just rebuild rather than trying to figure it out. +./ci/build.sh + +setup::activate + +deploy::build-docs diff --git a/.travis/build.sh b/ci/build.sh similarity index 92% rename from .travis/build.sh rename to ci/build.sh index 778b4411..2db0b6c9 100755 --- a/.travis/build.sh +++ b/ci/build.sh @@ -1,7 +1,7 @@ #!/bin/bash -ex # set up dependencies, etc -source ./.travis/lib-setup.sh +source ./ci/lib-setup.sh setup::install if [ x"$FLAKE" = "xyes" ]; then @@ -35,7 +35,7 @@ if [ $BUILD_RES -ne 0 ]; then exit $BUILD_RES fi -if [ x"$KRB5_VER" = "xheimdal" ] || [ "$TRAVIS_OS_NAME" = "windows" ]; then +if [ x"$KRB5_VER" = "xheimdal" ] || [ "$OS_NAME" = "windows" ]; then # heimdal/Windows can't run the tests yet, so just make sure it imports and exit python -c "import gssapi" exit $? diff --git a/.travis/lib-deploy.sh b/ci/lib-deploy.sh similarity index 79% rename from .travis/lib-deploy.sh rename to ci/lib-deploy.sh index 8b204529..25c11309 100644 --- a/.travis/lib-deploy.sh +++ b/ci/lib-deploy.sh @@ -7,7 +7,7 @@ deploy::build-docs() { pip install -e . # place in a non-standard location so that they don't get cleaned up - python setup.py build_sphinx --build-dir travis_docs_build + python setup.py build_sphinx --build-dir ci_docs_build - echo "travis_docs_build" + echo "docs_build" } diff --git a/.travis/lib-setup.sh b/ci/lib-setup.sh similarity index 64% rename from .travis/lib-setup.sh rename to ci/lib-setup.sh index 0f0c4ce2..c90b530f 100644 --- a/.travis/lib-setup.sh +++ b/ci/lib-setup.sh @@ -1,19 +1,9 @@ #!/bin/bash -setup::python-suffix() { - if [ x"$PYTHON" = "x3" ]; then - echo "3" - else - echo "" - fi -} - # We test Debian's cython. el7's cython is too old, and Rawhide's virtualenv # doesn't work right (usrmerge bugs) so we can only test Debian's cython. setup::debian::install() { - local IS3=$(setup::python-suffix) - export DEBIAN_FRONTEND=noninteractive apt-get update @@ -24,9 +14,9 @@ setup::debian::install() { gss-ntlmssp fi - apt-get -y install gcc virtualenv python$IS3-{virtualenv,dev} cython$IS3 + apt-get -y install gcc virtualenv python3-{virtualenv,dev} cython3 - virtualenv --system-site-packages -p $(which python${PYTHON}) .venv + virtualenv --system-site-packages -p $(which python3) .venv source ./.venv/bin/activate } @@ -36,11 +26,9 @@ setup::rh::yuminst() { } setup::centos::install() { - local IS3=$(setup::python-suffix) - # Cython on el7 is too old - downstream patches - setup::rh::yuminst python$IS3-{virtualenv,devel} - virtualenv -p $(which python$IS3) .venv + setup::rh::yuminst python3-{virtualenv,devel} + virtualenv -p $(which python3) .venv source ./.venv/bin/activate pip install --upgrade pip # el7 pip doesn't quite work right pip install --install-option='--no-cython-compile' cython @@ -49,8 +37,8 @@ setup::centos::install() { setup::fedora::install() { # path to binary here in case Rawhide changes it setup::rh::yuminst redhat-rpm-config \ - /usr/bin/virtualenv python${PYTHON}-{virtualenv,devel} - virtualenv -p $(which python${PYTHON}) .venv + /usr/bin/virtualenv python3-{virtualenv,devel} + virtualenv -p $(which python3) .venv source ./.venv/bin/activate pip install --install-option='--no-cython-compile' cython } @@ -67,22 +55,20 @@ setup::rh::install() { } setup::macos::install() { - # Install Python from pyenv so we know what version is being used. This - # doesn't work for newer macos. - pyenv install $PYENV - pyenv global $PYENV - virtualenv -p $(pyenv which python) .venv - source ./.venv/bin/activate + sudo pip3 install virtualenv + python3 -m virtualenv -p $(which python3) .venv + source .venv/bin/activate pip install --install-option='--no-cython-compile' cython } setup::windows::install() { - # Install the right Python version and MIT Kerberos - choco install python"${PYENV:0:1}" --version $PYENV - choco install mitkerberos --install-arguments "'ADDLOCAL=ALL'" || true - PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" - # Update path to include them - export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" + CHINST="choco install --no-progress --yes --ignore-detected-reboot --allow-downgrade" + + # Install MIT Kerberos. choco will fail despite the installation working. + $CHINST mitkerberos --install-arguments "'ADDLOCAL=ALL'" || true + + # Update path to include it + export PATH="/c/Program Files/MIT/Kerberos/bin:$PATH" python -m pip install --upgrade pip } @@ -94,7 +80,7 @@ setup::install() { setup::rh::install elif [ "$(uname)" == "Darwin" ]; then setup::macos::install - elif [ "$TRAVIS_OS_NAME" == "windows" ]; then + elif [ "$OS_NAME" == "windows" ]; then setup::windows::install else echo "Distro not found!" diff --git a/ci/release-win.sh b/ci/release-win.sh new file mode 100755 index 00000000..1e8aec4e --- /dev/null +++ b/ci/release-win.sh @@ -0,0 +1,49 @@ +#!/bin/bash -e + +source ./ci/lib-setup.sh +source ./ci/lib-deploy.sh + +./ci/build.sh + +# Sigh, go find paths again +export PATH="/c/Program Files/MIT/Kerberos/bin:$PATH" + +# build the wheel +python -m pip install wheel +python setup.py bdist_wheel + +cd dist + +tag=$(git describe --tags) + +# Rename and checksum the wheel +if [ x"${tag#v[0-9]}" = "x${tag}" ]; then + PYTHON_GSSAPI_VERSION=${tag} +else + PYTHON_GSSAPI_VERSION=${tag#v} +fi + +PKG_NAME_VER=$(ls *.whl | sed "s/gssapi-[^-]*-\(.*\)\.whl/python-gssapi-${PYTHON_GSSAPI_VERSION}-\1/") + +cp *.whl "${PKG_NAME_VER}.whl" + +sha512sum --binary ./${PKG_NAME_VER}.whl > ./${PKG_NAME_VER}.sha512sum + +cd .. + +# Hack around https://github.com/pypa/gh-action-pypi-publish/issues/32 + +echo 'Running: python -m pip install twine ...' +python -m pip install twine + +echo 'Running: set +x; python -m twine upload...' +# Please note this cannot be set -x or passwords will leak! +set +x + +python -m twine upload -u $TWINE_USER -p $TWINE_PASSWORD dist/gssapi* > out.log 2>&1 || true + +# and restore... +set -x +egrep -i 'fail|error' out.log && cat out.log && exit 1 + +exit 0 diff --git a/ci/run-on-linux.sh b/ci/run-on-linux.sh new file mode 100755 index 00000000..8e837615 --- /dev/null +++ b/ci/run-on-linux.sh @@ -0,0 +1,14 @@ +#!/bin/bash -ex + +# GitHub's YAML parser doesn't support anchors, so this is a separate file +# https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336 +sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts +sudo hostname test.box + +docker run \ + -v `pwd`:/tmp/build \ + -w /tmp/build \ + -e KRB5_VER=${KRB5_VER:-mit} \ + -e FLAKE=${FLAKE:-no} \ + $DISTRO \ + /bin/bash -ex $@ diff --git a/docs/source/conf.py b/docs/source/conf.py index 382b1617..6eeb768c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -58,9 +58,9 @@ # built documents. # # The short X.Y version. -version = '1.6.5' +version = '0.0.0-19' # The full version, including alpha/beta/rc tags. -release = '1.6.5' +release = '0.0.0-19' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 835808f0..b4d8125b 100755 --- a/setup.py +++ b/setup.py @@ -295,7 +295,7 @@ def gssapi_modules(lst): setup( name='gssapi', - version='1.6.5', + version='0.0.0-19', author='The Python GSSAPI Team', author_email='rharwood@redhat.com', packages=['gssapi', 'gssapi.raw', 'gssapi.raw._enum_extensions',