From ad8cc38acbf6ee491a865e8a479a435d281dac41 Mon Sep 17 00:00:00 2001 From: Ry Whittington Date: Fri, 25 Aug 2023 21:36:21 -0500 Subject: [PATCH] Add deploy job --- .github/workflows/workflow.yaml | 57 ++++++++++++++++++++++++++++----- tox.ini | 4 ++- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index ba09f32..77c1eba 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -45,20 +45,18 @@ name: Python package on: push: - branches: [ "develop", "feature/*" ] + branches: [ "develop", "feature/*", "hotfix/*"] pull_request: - branches: [ "develop" ] + branches: [ "develop", "master" ] jobs: - build: + qa: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + name: TOX on ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -68,6 +66,49 @@ jobs: python -m pip install tox tox-gh-actions - name: Test with tox run: tox +# dev-install: + deploy: + runs-on: ubuntu-latest + name: Build and publish to PYPI + needs: [qa] +# if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build + - name: Build distributions + run: python -m build + - name: check it + run: ls dist + +# +#deploy: +# +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v3 +# - name: Set up Python +# uses: actions/setup-python@v3 +# with: +# python-version: '3.x' +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip +# pip install build +# - name: Build package +# run: python -m build +# - name: Publish package +# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 +# with: +# user: __token__ +# password: ${{ secrets.PYPI_API_TOKEN }} #name: Python package # @@ -82,7 +123,7 @@ jobs: # name: tox on ${{ matrix.python-version }} # runs-on: ubuntu-latest # env: -# USING_COVERAGE: '3.6,3.8' +# USING_COVERAGE: "3.6,3.8" # # strategy: # matrix: diff --git a/tox.ini b/tox.ini index 8b523c2..efd13ef 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,9 @@ python = 3.8: py38 3.9: py39 3.10: py310 - 3.11: py311, lint, format +; 3.11: py311, lint, format skipping lint and format for now + 3.11: py311 + [testenv:py{36, 37, 38, 39, 310, 311}] description = run unit tests