diff --git a/.github/actions/build-dist/action.sh b/.github/actions/build-dist/action.sh new file mode 100755 index 00000000..9ff0a5e1 --- /dev/null +++ b/.github/actions/build-dist/action.sh @@ -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/ . diff --git a/.github/actions/build-dist/action.yml b/.github/actions/build-dist/action.yml new file mode 100644 index 00000000..0c716658 --- /dev/null +++ b/.github/actions/build-dist/action.yml @@ -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" diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 00000000..570b1e94 --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -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 }} diff --git a/extra_model/__init__.py b/extra_model/__init__.py index dc1f3ad0..d1ad2c2f 100644 --- a/extra_model/__init__.py +++ b/extra_model/__init__.py @@ -2,4 +2,4 @@ from extra_model._models import ExtraModel, extra_factory # noqa -__version__ = "0.1.0" +__version__ = "0.2.0rc0" diff --git a/extra_model/py.typed b/extra_model/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/setup.cfg b/setup.cfg index 250018dc..9c6d0bc2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -31,7 +31,6 @@ install_requires = packages = find: [options.package_data] - extra_model = py.typed [options.packages.find]