diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 73b0a27..e1e1532 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,38 +14,7 @@ on: types: [published] workflow_dispatch: -permissions: - contents: read - jobs: deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - # use fetch --all for setuptools_scm to work - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: python -m pip install --upgrade pip twine - - name: Build wheel - run: python -m pip wheel -w dist . - - name: Check distribution - run: twine check dist/* - - name: Publish package (to TestPyPI) - if: github.event_name == 'workflow_dispatch' && github.repository == 'cpp-linter/clang-tools-pip' - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} - run: twine upload --repository testpypi dist/* - - name: Publish package (to PyPI) - if: github.event_name != 'workflow_dispatch' && github.repository == 'cpp-linter/clang-tools-pip' - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: twine upload dist/* + uses: cpp-linter/.github/.github/workflows/py-publish.yml@main + secrets: inherit diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 0d5aa8c..b4102c2 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -31,6 +31,7 @@ jobs: run: | python3 -m pip install --upgrade pip python3 -m pip install . -r requirements-dev.txt + - name: Run pre-commit run: pre-commit run --all-files @@ -133,30 +134,6 @@ jobs: fi docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - run: python -m pip install . -r docs/requirements.txt - - - name: Build docs - working-directory: docs - run: sphinx-build -E -W -b html . _build/html - - - name: Save built docs as artifact - uses: actions/upload-artifact@v4 - with: - name: "clang-tools-pip_docs" - path: docs/_build/html - - - name: Upload to github pages - # only publish doc changes from main branch - if: github.ref == 'refs/heads/main' - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build/html + uses: cpp-linter/.github/.github/workflows/sphinx.yml@main + with: + path-to-doc: docs/_build/html diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index fb8f44b..2250d38 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,10 +7,5 @@ on: workflow_dispatch: jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Draft your next Release notes as Pull Requests are merged into the default branch - - uses: release-drafter/release-drafter@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + draft-release: + uses: cpp-linter/.github/.github/workflows/release-drafter.yml@main