Skip to content

Commit 8d535b4

Browse files
authored
Develop (#40)
* Adiciona a funcionalidade de strict para os dados retornados da API e faz o bump da versao (#36) * Workflow (#39) * add tests.yml * set locale * fix publish to pypi
1 parent bed259a commit 8d535b4

File tree

2 files changed

+66
-29
lines changed

2 files changed

+66
-29
lines changed
Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI
1+
name: Upload Python Package
22

33
on:
44
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
108

119
jobs:
12-
build-n-publish:
13-
name: Build and publish Python 🐍 distributions 📦 to PyPI
10+
release:
11+
name: Create Release
1412
runs-on: ubuntu-18.04
1513
steps:
16-
- uses: actions/checkout@master
17-
18-
- name: Set up Python 3.7
19-
uses: actions/setup-python@v1
14+
- name: Checkout code
15+
uses: actions/checkout@master
16+
- name: Create Release
17+
id: create_release
18+
uses: actions/create-release@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
2021
with:
21-
python-version: 3.7
22-
23-
- name: Install package dependencies
24-
run: python -m pip install .[dev]
25-
26-
- name: Test with pytest
27-
run: python -m pytest
28-
29-
- name: Build a binary wheel and a source tarball
30-
run: python setup.py sdist bdist_wheel
31-
32-
- name: Publish distribution 📦 to PyPI
33-
if: startsWith(github.ref, 'refs/tags')
34-
uses: pypa/gh-action-pypi-publish@master
35-
with:
36-
user: __token__
37-
password: ${{ secrets.pypi_password }}
22+
tag_name: ${{ github.ref }}
23+
release_name: Release ${{ github.ref }}
24+
body: |
25+
Changes in this Release
26+
draft: false
27+
prerelease: false
28+
deploy:
29+
needs: release
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v1
33+
- name: Set up Python
34+
uses: actions/setup-python@v1
35+
with:
36+
python-version: '3.x'
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install setuptools wheel
41+
- name: Build
42+
run: |
43+
python setup.py sdist bdist_wheel
44+
- name: Publish distribution 📦 to PyPI
45+
uses: pypa/gh-action-pypi-publish@master
46+
with:
47+
user: __token__
48+
password: ${{ secrets.pypi_password }}

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-18.04
8+
strategy:
9+
max-parallel: 4
10+
matrix:
11+
python-version: [3.5, 3.6, 3.7, 3.8]
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set locale
16+
run: sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen pt_BR.UTF-8
17+
18+
- name: Setup Python
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies with pip
24+
run: |
25+
python -m pip install .[dev]
26+
- run: pytest

0 commit comments

Comments
 (0)