Skip to content

Commit

Permalink
Merge pull request #36 from wayfair-incubator/cantonellis_upload_to_pypi
Browse files Browse the repository at this point in the history
upload to pypi
  • Loading branch information
chrisantonellis authored Feb 24, 2021
2 parents b5c5ddd + fca9113 commit d0805dc
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/actions/build-dist/action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -euo pipefail

echo "Ensuring pip is up to date"
python -m pip install --upgrade pip
echo "Installing the latest version of pypa/build"
pip install build

python -m build --sdist --wheel --outdir dist/ .
8 changes: 8 additions & 0 deletions .github/actions/build-dist/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: "Build Python package"
description: "Build a wheel and sdist for the package"
runs:
using: "composite"
steps:
- name: "Build wheel"
run: "$GITHUB_ACTION_PATH/action.sh"
shell: "bash"
27 changes: 27 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Release
env:
PYTHON_VERSION: "3.6"
on:
release:
types: [published]
jobs:
build-and-publish-wheel-to-pypi:
runs-on: "ubuntu-latest"
environment: "Publish Release"
steps:
- name: "Check out code"
uses: "actions/checkout@v2"

- uses: "actions/setup-python@v2"
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: "Build wheel"
uses: "./.github/actions/build-dist"

# v1.4.2 release. Using full SHA for security
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
- name: "Publish distribution 📦 to PyPI"
uses: "pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29"
with:
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion extra_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from extra_model._models import ExtraModel, extra_factory # noqa

__version__ = "0.1.0"
__version__ = "0.2.0rc0"
Empty file added extra_model/py.typed
Empty file.
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = extra-model
author = Chris Antonellis
author_email = cantonellis@wayfair.com
author = Misha Balyasin
author_email = mbalyasin@wayfair.com
version = attr: extra_model.__version__
description = DESCRIPTION
long_description = file: README.md
Expand Down Expand Up @@ -31,7 +31,6 @@ install_requires =
packages = find:

[options.package_data]

extra_model = py.typed

[options.packages.find]
Expand Down

0 comments on commit d0805dc

Please sign in to comment.