Skip to content

Commit

Permalink
Develop (#40)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rafpyprog authored Nov 4, 2020
1 parent bed259a commit 8d535b4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 29 deletions.
69 changes: 40 additions & 29 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
name: Publish Python 🐍 distributions 📦 to PyPI
name: Upload Python Package

on:
push:
branches:
- main
pull_request:
branches:
- main
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
release:
name: Create Release
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master

- name: Set up Python 3.7
uses: actions/setup-python@v1
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
python-version: 3.7

- name: Install package dependencies
run: python -m pip install .[dev]

- name: Test with pytest
run: python -m pytest

- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
draft: false
prerelease: false
deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2

- name: Set locale
run: sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen pt_BR.UTF-8

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies with pip
run: |
python -m pip install .[dev]
- run: pytest

0 comments on commit 8d535b4

Please sign in to comment.