Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github Actions workflow to build and deploy on Test PyPi and PyPi #820

Merged
merged 11 commits into from
Oct 9, 2020
41 changes: 41 additions & 0 deletions .github/workflows/action-pypi-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: PyPi Build and Deploy 🐍📦

on:
push:
branches:
- master

jobs:
build-n-publish:
name: Build and publish ESMValCore on PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install pep517
run: >-
python -m
pip install
pep517
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
pep517.build
--source
--binary
--out-dir dist/
.
#- name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.test_pypi_password }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

from setuptools import Command, setup

from esmvalcore._version import __version__
sys.path.insert(0, os.path.dirname(__file__))
from esmvalcore._version import __version__ # noqa: E402

PACKAGES = [
'esmvalcore',
Expand Down