From 07c1c9419cb1106147603714dc6af01b8f2d8d19 Mon Sep 17 00:00:00 2001 From: ansys-medson <92183544+ansys-medson@users.noreply.github.com> Date: Fri, 3 Feb 2023 09:17:08 -0500 Subject: [PATCH 1/4] Updated release job --- .github/workflows/ci_cd.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6b4dd6e4..3c584210 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -60,17 +60,11 @@ jobs: run: | pip install build python -m build - pip install dist/ansys_sherlock-0.1.dev0-py3-none-any.whl + pip install dist/ansys-sherlock-0.1.dev0-py3-none-any.whl python -c "from ansys.sherlock import core as pysherlock; print('Successful import')" - name: Test with pytest # Only the tox environment specified in the tox.ini gh-actions is run run: pytest - - - name: Upload ansys-sherlock artifact - uses: actions/upload-artifact@v3 - with: - name: ansys-sherlock - path: dist docs: name: Documentation @@ -123,26 +117,30 @@ jobs: needs: [ style, tests, docs ] runs-on: ubuntu-latest steps: + - name: Checkout repository + - uses: actions/checkout@v3 + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build twine + + - name: Build artifacts + run: | + python -m build && python -m twine check dist/* - - uses: actions/download-artifact@v3 - with: - name: ansys-sherlock - path: dist - - # list current directory - name: List directory structure run: ls -R - name: Upload to Private PyPi - run: | - pip install twine - python -m twine upload --skip-existing ./**/*.whl - python -m twine upload --skip-existing ./**/*.tar.gz env: TWINE_USERNAME: PAT TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload + run: | + python -m twine upload dist/* \ + From 6efc8066554654236364e319f245b82e3e0983b7 Mon Sep 17 00:00:00 2001 From: ansys-medson <92183544+ansys-medson@users.noreply.github.com> Date: Fri, 3 Feb 2023 09:22:44 -0500 Subject: [PATCH 2/4] pyansys/actions/release-pypi-private --- .github/workflows/ci_cd.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 3c584210..2b2b42b0 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -135,12 +135,13 @@ jobs: - name: List directory structure run: ls -R + + - name: "Release to the private PyPI repository" + uses: pyansys/actions/release-pypi-private@v3 + with: + library-name: "ansys-sherlock" + twine-username: "__token__" + twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} + - - name: Upload to Private PyPi - env: - TWINE_USERNAME: PAT - TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} - TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload - run: | - python -m twine upload dist/* \ From c5ea4abb1ab8d696918c18ecd061389678f4f5b4 Mon Sep 17 00:00:00 2001 From: ansys-medson <92183544+ansys-medson@users.noreply.github.com> Date: Fri, 3 Feb 2023 09:23:52 -0500 Subject: [PATCH 3/4] Fixed syntax --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 2b2b42b0..9d53fb0a 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -118,7 +118,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - - uses: actions/checkout@v3 + uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 From 558f8e9bcf34ccec9d0e2068f657b5e6309299eb Mon Sep 17 00:00:00 2001 From: ansys-medson <92183544+ansys-medson@users.noreply.github.com> Date: Fri, 3 Feb 2023 09:40:14 -0500 Subject: [PATCH 4/4] Updated test build package name --- .github/workflows/ci_cd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 9d53fb0a..a5f62d79 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -48,24 +48,29 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip poetry pytest python -m pip install ansys-api-sherlock --index-url 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/' --no-dependencies + - name: Install ansys-sherlock-core run: | pip install build python -m build - pip install dist/ansys-sherlock-0.1.dev0-py3-none-any.whl + pip install dist/ansys_sherlock-0.1.dev0-py3-none-any.whl python -c "from ansys.sherlock import core as pysherlock; print('Successful import')" + - name: Test with pytest # Only the tox environment specified in the tox.ini gh-actions is run run: pytest + docs: name: Documentation runs-on: ubuntu-latest