|
1 | | -# This workflow will upload a Python Package using Twine when a release is created |
2 | | -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries |
3 | | - |
4 | | -# This workflow uses actions that are not certified by GitHub. |
5 | | -# They are provided by a third-party and are governed by |
6 | | -# separate terms of service, privacy policy, and support |
7 | | -# documentation. |
8 | | - |
9 | 1 | name: Upload Python Package |
10 | 2 |
|
11 | 3 | on: |
|
14 | 6 | types: [published] |
15 | 7 | workflow_dispatch: |
16 | 8 |
|
17 | | -permissions: |
18 | | - contents: read |
19 | | - |
20 | 9 | jobs: |
21 | 10 | deploy: |
22 | | - |
23 | | - runs-on: ubuntu-latest |
24 | | - |
25 | | - steps: |
26 | | - - uses: actions/checkout@v4 |
27 | | - # use fetch --all for setuptools_scm to work |
28 | | - with: |
29 | | - fetch-depth: 0 |
30 | | - - name: Set up Python |
31 | | - uses: actions/setup-python@v5 |
32 | | - with: |
33 | | - python-version: '3.x' |
34 | | - - name: Install dependencies |
35 | | - run: python -m pip install --upgrade pip twine |
36 | | - - name: Build wheel |
37 | | - run: python -m pip wheel -w dist . |
38 | | - - name: Check distribution |
39 | | - run: twine check dist/cpp_linter_hooks* |
40 | | - - name: Publish package (to TestPyPI) |
41 | | - if: github.event_name == 'workflow_dispatch' && github.repository == 'cpp-linter/cpp-linter-hooks' |
42 | | - env: |
43 | | - TWINE_USERNAME: __token__ |
44 | | - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} |
45 | | - run: twine upload --repository testpypi dist/cpp_linter_hooks* |
46 | | - - name: Publish package (to PyPI) |
47 | | - if: github.event_name != 'workflow_dispatch' && github.repository == 'cpp-linter/cpp-linter-hooks' |
48 | | - env: |
49 | | - TWINE_USERNAME: __token__ |
50 | | - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
51 | | - run: twine upload dist/cpp_linter_hooks* |
| 11 | + uses: cpp-linter/.github/.github/workflows/py-publish.yml@main |
0 commit comments