diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6b4dd6e4..a5f62d79 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -48,29 +48,28 @@ 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 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 +122,31 @@ 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: "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 - 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 + +