From 46233a93ed174e58dea35ca53a4d42cbfd4a6144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Senart?= Date: Fri, 9 Apr 2021 14:03:39 +0200 Subject: [PATCH] Improve CI/CD workflow. --- .github/workflows/python-package.yml | 11 ++++++++++- .github/workflows/python-publish.yml | 13 +++++++++++-- setup.cfg | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6c676f4..70cf32d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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: | @@ -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' diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 862348d..50c5a07 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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: | @@ -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/* diff --git a/setup.cfg b/setup.cfg index 9d9f392..f59191b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,4 +46,4 @@ console_scripts = [bdist_wheel] universal = False plat-name = any -python-tag = cp38 +python-tag = py38