Skip to content

Commit

Permalink
CD to pypi.org
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhammerl committed Jul 6, 2021
1 parent 9abb20b commit dd3f48c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,33 @@ jobs:
- name: Unit test
run: pipenv run test-unit

deploy:
needs: test
if: contains(github.ref, 'refs/tags/releases/v')
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install pipenv
run: python -m pip install --upgrade twine wheel

- name: Get version
run: |
echo ${{ github.ref }} | sed 's/refs\/tags\/releases\/v//g' > VERSION
cat VERSION
- name: Build
run: python setup.py sdist bdist_wheel

- name: Publish distribution 📦 to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ __pycache__/

.DS_Store
.vim
VERSION
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include resultify/py.typed
include resultify/py.typed LICENSE README.md VERSION
prune test/
include LICENSE README.md
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

setup(
name="resultify",
version="1.0.0",
version=open("VERSION", "r").read().strip(),
description="A rust-like result type for Python",
long_description=open("README.md").read(),
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
url="https://github.com/felixhammerl/resultify",
author="Felix Hammerl",
Expand Down

0 comments on commit dd3f48c

Please sign in to comment.