Skip to content

Commit

Permalink
Merge pull request #60 from pyansys/ansys-medson-patch-1
Browse files Browse the repository at this point in the history
Updated release job
  • Loading branch information
ansys-medson authored Feb 3, 2023
2 parents b258871 + 558f8e9 commit 353a191
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


0 comments on commit 353a191

Please sign in to comment.