From 75e8e50dd964e5cd88a5f11a9453367111c66e66 Mon Sep 17 00:00:00 2001 From: Erik Nielsen Date: Sun, 3 Oct 2021 20:16:48 -0600 Subject: [PATCH] Some final updates to github actions before new release. - Removes "extra tests" (test_packages) from master branch - if we want to run tests on master we can/should do this separately. - adds deploy.yml that should perform actual deployment to pypi when a commit is pusehd to master with a tag. --- .github/workflows/deploy.yml | 80 ++++++++++++++++++++++++++++++++++++ .github/workflows/extras.yml | 2 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..8a01cfce1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,80 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Deploy new version on pypi.org + +on: + push: + branches: [ "master" ] + + # Allow running manually from Actions tab + workflow_dispatch: + + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly) + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Build wheels + uses: pypa/cibuildwheel@v2.1.2 + env: + CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* + CIBW_BUILD_VERBOSITY: 1 + CIBW_BEFORE_ALL_LINUX: ./.github/ci-scripts/before_install.sh + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly) + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - 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 + + - name: Publish package on PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true diff --git a/.github/workflows/extras.yml b/.github/workflows/extras.yml index 93a3ede4d..3bf026459 100644 --- a/.github/workflows/extras.yml +++ b/.github/workflows/extras.yml @@ -5,7 +5,7 @@ name: Build and run test extras on: push: - branches: [ "master", "beta" ] + branches: [ "beta" ] #pull_requests # branches: [ "master", "develop", "beta" ] # Allow running manually from Actions tab