Skip to content

Commit

Permalink
feat: GitHub Action to publish the package (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandobrito authored Aug 6, 2021
1 parent f5ceaf7 commit 57faab4
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package

on:
release:
types: [released]

jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9.x'

- name: Build the distribution package
run: make build

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
_version.py

# Unit test / coverage reports
htmlcov/
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.PHONY: build
build: clean-build
python3 setup.py sdist bdist_wheel

.PHONY: clean-build
clean-build:
rm -rf build dist

.PHONY: type
type:
@echo "Running mypy"
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]

[tool.setuptools_scm]
local_scheme = "no-local-version"

[tool.black]
skip-string-normalization = true
line-length = 100
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@
# Based on: https://packaging.python.org/tutorials/packaging-projects/
setup(
name='dbt-exposures-crawler',
version='0.0.1',
use_scm_version={
"write_to": "src/exposurescrawler/_version.py",
"write_to_template": '__version__ = "{version}"\n',
"local_scheme": "no-local-version",
},
description='Extracts information from different systems and convert them to dbt exposures',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/voi-oss',
url='https://github.com/voi-oss/dbt-exposures-crawler',
author='Voi Technology AB',
license='Apache License, Version 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License 2.0 (Apache-2.0)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3 :: Only',
],
package_dir={'': 'src'},
packages=find_packages(where='src'),
python_requires='>=3.9, <4',
setup_requires=['wheel', 'setuptools_scm'],
install_requires=[
'click ~= 8.0.1',
'python-slugify ~= 4.0.1',
Expand Down

0 comments on commit 57faab4

Please sign in to comment.