-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Erik Nielsen
committed
Oct 4, 2021
1 parent
78c5f52
commit 75e8e50
Showing
2 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters