Skip to content

Commit 16dbe6a

Browse files
MiriamT94Miriam
andauthored
Automate workflow (#129)
* Adding workflow * version change * reverting pylint changes * updating all to latest versions * prospector changes * fixing test * undoing prospector fixes * undoing buildspec changes * testing pip * Automating Publishing Co-authored-by: Miriam <[email protected]>
1 parent 073797e commit 16dbe6a

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish 🐍 distributions 📦 to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build-and-publish:
9+
name: Build and publish 🐍 distributions 📦 to PyPI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository code
13+
uses: actions/checkout@v2
14+
15+
- name: Fetch version
16+
run: |
17+
output="$(python setup.py --version)"
18+
echo "::set-output name=version::$output"
19+
id: setup_version
20+
- name: Print build version
21+
run: echo "${{ steps.setup_version.outputs.version }}"
22+
23+
# Setup Python (faster than using Python container)
24+
- name: Setup Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: "3.7"
28+
29+
- name: Install pipenv
30+
run: |
31+
python -m pip install --upgrade pipenv wheel
32+
- id: cache-pipenv
33+
uses: actions/cache@v1
34+
with:
35+
path: ~/.local/share/virtualenvs
36+
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
37+
38+
- name: Install dependencies
39+
if: steps.cache-pipenv.outputs.cache-hit != 'true'
40+
run: |
41+
pipenv install --deploy --dev
42+
43+
- name: Build a binary wheel and a source tarball
44+
run: |
45+
pipenv run build
46+
# git tag created using version specified in setup.py
47+
- name: Bump git tag version
48+
id: tag_version
49+
uses: mathieudutour/[email protected]
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
custom_tag: ${{ steps.setup_version.outputs.version }}
53+
- name: Create a GitHub release
54+
uses: ncipollo/release-action@v1
55+
with:
56+
tag: ${{ steps.tag_version.outputs.new_tag }}
57+
name: Release ${{ steps.tag_version.outputs.new_tag }}
58+
body: ${{ github.event.head_commit.message }}
59+
60+
- name: Publish distribution 📦 to Test PyPI
61+
uses: pypa/gh-action-pypi-publish@master
62+
with:
63+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
64+
repository_url: https://test.pypi.org/legacy/
65+
verbose: true
66+
skip_existing: true
67+
68+
- name: Publish distribution 📦 to PyPI
69+
uses: pypa/gh-action-pypi-publish@master
70+
with:
71+
password: ${{ secrets.PYPI_API_TOKEN }}
72+
verbose: true

Pipfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
pyjwt = "==1.7.1"
8+
9+
[dev-packages]
10+
pytest = "*"
11+
setuptools = "*"
12+
wheel = "*"
13+
twine = "*"
14+
tqdm = "*"
15+
pre-commit = "*"
16+
commitizen = "*"
17+
toml = "*"
18+
coverage = "*"
19+
bandit = "*"
20+
pylint_quotes = "*"
21+
schema ="*"
22+
PyJWT ="*"
23+
boto3="*"
24+
25+
[requires]
26+
python_version = "3.7"
27+
28+
[scripts]
29+
test = "pytest"
30+
build = "python3 setup.py sdist bdist_wheel"
31+
deploy = "twine upload dist/*"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
LONG_DESCRIPTION = open("README.md").read()
44

55
setup(name="aws-lambda-decorators",
6-
version="0.52",
6+
version="0.53",
77
description="A set of python decorators to simplify aws python lambda development",
88
long_description=LONG_DESCRIPTION,
99
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)