Skip to content

Commit

Permalink
Improve CI/CD workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssenart committed Apr 9, 2021
1 parent ce61f81 commit 46233a9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
Expand Down Expand Up @@ -51,3 +51,12 @@ jobs:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}

- name: Wheel Python Tag creation
uses: frabert/replace-string-action@master
id: python-tag
with:
pattern: '(\w+)\.(\w+)'
string: '${{ matrix.python-version }}'
replace-with: 'py$1$2'
flags: 'g'
13 changes: 11 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
Expand Down Expand Up @@ -54,11 +54,20 @@ jobs:
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}

- name: Wheel Python Tag creation
uses: frabert/replace-string-action@master
id: python-tag
with:
pattern: '(\w+)\.(\w+)'
string: '${{ matrix.python-version }}'
replace-with: 'py$1$2'
flags: 'g'

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python updateVersion.py --nextVersion ${{ github.event.release.tag_name }}
python setup.py sdist bdist_wheel
python setup.py sdist bdist_wheel --python-tag ${{ steps.python-tag.outputs.replaced }}
twine upload dist/*
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ console_scripts =
[bdist_wheel]
universal = False
plat-name = any
python-tag = cp38
python-tag = py38

0 comments on commit 46233a9

Please sign in to comment.