Skip to content

Commit

Permalink
Check Build and Test Publish (#11)
Browse files Browse the repository at this point in the history
* renamed build + added check_build

* separated build and publish tasks

* added publish to testpyp on tag

* added twin targets

* fixed tag pattern
  • Loading branch information
davidlday authored Aug 25, 2021
1 parent 702118f commit 70d4a18
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
Expand All @@ -10,7 +7,6 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -21,10 +17,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Build Dists
run: |
python -m build
twine upload dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/pypi-test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Upload Python Package

on:
push:
tags:
- "*"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build Dists
run: |
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
20 changes: 19 additions & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
args: pip install .; pylint src/**/*.py

build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -39,3 +39,21 @@ jobs:
run: |
pip install cmudict pytest
pytest
check_build:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build
run: python -m build
- name: Check
run: twine check dist/*

0 comments on commit 70d4a18

Please sign in to comment.