From 8f18cbb92b15c0c8c71e98a1166b0e6e0e772462 Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 18:48:02 -0700 Subject: [PATCH 1/8] Create github-deploy.yml --- .github/workflows/github-deploy.yml | 81 +++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/github-deploy.yml diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml new file mode 100644 index 0000000..1579977 --- /dev/null +++ b/.github/workflows/github-deploy.yml @@ -0,0 +1,81 @@ +name: Build and upload to PyPI + +# Build on every branch push, tag push, and pull request change: +#on: [push, pull_request] +# Alternatively, to publish when a (published) GitHub Release is created, use the following: +on: +# push: +# pull_request: + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.5.5 + + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + alternatively, to publish when a GitHub Release is created, use the following rule: + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: repository_url: https://test.pypi.org/legacy/ From f547726f52243667affcb5785cf0acfc7cb35b2a Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 18:54:39 -0700 Subject: [PATCH 2/8] Update github-deploy.yml --- .github/workflows/github-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index 1579977..f9e48f5 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -65,8 +65,8 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') - alternatively, to publish when a GitHub Release is created, use the following rule: + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v2 From f69a07f8f263c9803604e04d626381b41200d7f9 Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:07:49 -0700 Subject: [PATCH 3/8] Update github-deploy.yml --- .github/workflows/github-deploy.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index f9e48f5..fc45cd4 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -1,14 +1,17 @@ name: Build and upload to PyPI # Build on every branch push, tag push, and pull request change: -#on: [push, pull_request] +on: [push, pull_request] # Alternatively, to publish when a (published) GitHub Release is created, use the following: -on: +# on: # push: # pull_request: - release: - types: - - published +# release: +# types: +# - published + +env: + CIBW_SKIP: cp27-* pp27-* # skip python2.7 builds jobs: build_wheels: From 96f147d128a7ae07cfb08b01cd14339231eefe0e Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:21:12 -0700 Subject: [PATCH 4/8] Update github-deploy.yml --- .github/workflows/github-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index fc45cd4..ee1ff73 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -12,6 +12,7 @@ on: [push, pull_request] env: CIBW_SKIP: cp27-* pp27-* # skip python2.7 builds + CIBW_BEFORE_BUILD: pip install . jobs: build_wheels: From b5e2b1611db5a7d5dc0f1c17fc8fea548859a547 Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:35:13 -0700 Subject: [PATCH 5/8] Update github-deploy.yml --- .github/workflows/github-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index ee1ff73..7df8ae1 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -12,7 +12,7 @@ on: [push, pull_request] env: CIBW_SKIP: cp27-* pp27-* # skip python2.7 builds - CIBW_BEFORE_BUILD: pip install . + #CIBW_BEFORE_BUILD: pip install . jobs: build_wheels: @@ -41,6 +41,8 @@ jobs: - name: Build wheels run: | + echo $PATH + echo $PWD python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From 3bf4a3d3e9f858e5e3c2276ba4b985c2f48e3860 Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:41:04 -0700 Subject: [PATCH 6/8] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 59ba618..9457062 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ GLPK_SRC_DIR = pathlib.Path('glpk-4.65/src') def scrape_makefile_list(filename, START_TOKEN, END_TOKEN): - with open(filename, 'r', encoding='utf-8') as f: + with open(str(filename), 'r', encoding='utf-8') as f: _contents = f.read() sidx = _contents.find(START_TOKEN) eidx = _contents.find(END_TOKEN) From 973c3a14052edbc1e63b7392c9846de87fd483a6 Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:59:00 -0700 Subject: [PATCH 7/8] Update github-deploy.yml --- .github/workflows/github-deploy.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github-deploy.yml b/.github/workflows/github-deploy.yml index 7df8ae1..02e6a48 100644 --- a/.github/workflows/github-deploy.yml +++ b/.github/workflows/github-deploy.yml @@ -1,18 +1,17 @@ name: Build and upload to PyPI # Build on every branch push, tag push, and pull request change: -on: [push, pull_request] +# on: [push, pull_request] # Alternatively, to publish when a (published) GitHub Release is created, use the following: -# on: +on: # push: # pull_request: -# release: -# types: -# - published + release: + types: + - published env: CIBW_SKIP: cp27-* pp27-* # skip python2.7 builds - #CIBW_BEFORE_BUILD: pip install . jobs: build_wheels: @@ -41,8 +40,6 @@ jobs: - name: Build wheels run: | - echo $PATH - echo $PWD python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v2 From 86f2025b61c634184f484de8e5d4f136a26edfad Mon Sep 17 00:00:00 2001 From: Nicholas McKibben Date: Wed, 29 Jul 2020 19:59:40 -0700 Subject: [PATCH 8/8] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9457062..071be41 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def get_export_symbols(self, ext): setup( name='scikit-glpk', - version='0.1.3', + version='0.1.4', author='Nicholas McKibben', author_email='nicholas.bgp@gmail.com', url='https://github.com/mckib2/scikit-glpk',