Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to reusable workflows #82

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
31 changes: 4 additions & 27 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
9 changes: 2 additions & 7 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading