Skip to content

Commit 353a191

Browse files
authored
Merge pull request #60 from pyansys/ansys-medson-patch-1
Updated release job
2 parents b258871 + 558f8e9 commit 353a191

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

.github/workflows/ci_cd.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,28 @@ jobs:
4848

4949
steps:
5050
- uses: actions/checkout@v3
51+
5152
- name: Set up Python ${{ matrix.python-version }}
5253
uses: actions/setup-python@v4
5354
with:
5455
python-version: ${{ matrix.python-version }}
56+
5557
- name: Install dependencies
5658
run: |
5759
python -m pip install --upgrade pip poetry pytest
5860
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
61+
5962
- name: Install ansys-sherlock-core
6063
run: |
6164
pip install build
6265
python -m build
6366
pip install dist/ansys_sherlock-0.1.dev0-py3-none-any.whl
6467
python -c "from ansys.sherlock import core as pysherlock; print('Successful import')"
68+
6569
- name: Test with pytest
6670
# Only the tox environment specified in the tox.ini gh-actions is run
6771
run: pytest
68-
69-
- name: Upload ansys-sherlock artifact
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: ansys-sherlock
73-
path: dist
72+
7473

7574
docs:
7675
name: Documentation
@@ -123,26 +122,31 @@ jobs:
123122
needs: [ style, tests, docs ]
124123
runs-on: ubuntu-latest
125124
steps:
125+
- name: Checkout repository
126+
uses: actions/checkout@v3
127+
126128
- name: Set up Python
127129
uses: actions/setup-python@v4
128130
with:
129131
python-version: ${{ env.MAIN_PYTHON_VERSION }}
132+
133+
- name: Install dependencies
134+
run: |
135+
python -m pip install --upgrade pip build twine
136+
137+
- name: Build artifacts
138+
run: |
139+
python -m build && python -m twine check dist/*
130140
131-
- uses: actions/download-artifact@v3
132-
with:
133-
name: ansys-sherlock
134-
path: dist
135-
136-
# list current directory
137141
- name: List directory structure
138142
run: ls -R
143+
144+
- name: "Release to the private PyPI repository"
145+
uses: pyansys/actions/release-pypi-private@v3
146+
with:
147+
library-name: "ansys-sherlock"
148+
twine-username: "__token__"
149+
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
139150

140-
- name: Upload to Private PyPi
141-
run: |
142-
pip install twine
143-
python -m twine upload --skip-existing ./**/*.whl
144-
python -m twine upload --skip-existing ./**/*.tar.gz
145-
env:
146-
TWINE_USERNAME: PAT
147-
TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
148-
TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload
151+
152+

0 commit comments

Comments
 (0)