Skip to content

Commit

Permalink
Create Github Actions workflow to build and deploy on Test PyPi and P…
Browse files Browse the repository at this point in the history
…yPi (#820)
  • Loading branch information
valeriupredoi authored Oct 9, 2020
1 parent 04c029d commit 301ec5a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
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

0 comments on commit 301ec5a

Please sign in to comment.