Skip to content

Commit

Permalink
feat(pypi): add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Caceresenzo committed Mar 22, 2023
1 parent 7786d1d commit 7d9e853
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PyPI Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install tools
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
- name: Build Package
run: make build

- name: Publish Package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ init:

install: init
$(PIP) install -e .

uninstall: init
$(PIP) uninstall crunch

.PHONY: init install
build:
rm -rf build *.egg-info dist
python setup.py sdist bdist_wheel

.PHONY: init install uninstall build
6 changes: 3 additions & 3 deletions crunch_cli/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'crunch'
__description__ = 'crunch - CLI of the CrunchDAO Platform'
__version__ = '0.0.1'
__title__ = 'crunch-cli'
__description__ = 'crunch-cli - CLI of the CrunchDAO Platform'
__version__ = '0.0.2'
__author__ = 'Enzo CACERES'
__author_email__ = '[email protected]'
__url__ = 'https://github.com/crunchdao/crunch-cli'
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
with open('requirements.txt') as fd:
requirements = fd.read().splitlines()

with open('README.md') as fd:
readme = fd.read()

setup(
name=about['__title__'],
description=about['__description__'],
long_description=readme,
long_description_content_type='text/markdown',
version=about['__version__'],
author=about['__author__'],
author_email=about['__author_email__'],
Expand Down

0 comments on commit 7d9e853

Please sign in to comment.