-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from mercadopago/feature/Actions_CI_and_CD
Actions CI and CD
- Loading branch information
Showing
3 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This workflow will install Python dependencies and upload a version in the PyPI | ||
name: CD - Upload PyPI | ||
|
||
on: | ||
release: | ||
types: [ released ] | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Sets up python | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
# Install dependencies | ||
- name: "Installs dependencies" | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install setuptools wheel twine | ||
python3 setup.py install | ||
# Build and upload to PyPI | ||
- name: "Builds and uploads to PyPI" | ||
run: | | ||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine check dist/* | ||
python3 -m twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow will install Python dependencies and upload a version in the PyPI test environment | ||
name: CD - Test PyPI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Sets up python | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
# Install dependencies | ||
- name: "Installs and upgrades pip, installs other dependencies and installs the package from setup.py" | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install setuptools wheel twine | ||
python3 setup.py install | ||
# Upload to TestPyPI | ||
- name: Build and Upload to TestPyPI | ||
run: | | ||
python3 setup.py sdist bdist_wheel | ||
python3 -m twine check dist/* | ||
python3 -m twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} | ||
TWINE_REPOSITORY: testpypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters