Skip to content

Commit

Permalink
Some final updates to github actions before new release.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Erik Nielsen committed Oct 4, 2021
1 parent 78c5f52 commit 75e8e50
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
2 changes: 1 addition & 1 deletion .github/workflows/extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75e8e50

Please sign in to comment.