diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d8d7eb1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: 2.1 - -orbs: - python: rohanpm/python@1.3.0 - -workflows: - version: 2 - ci-cd: - jobs: - - python/tox: - name: Python 3.8 tests - toxenv: py38 - executor: python/python38 - filters: &ci_filters - branches: - ignore: gh-pages - tags: - only: /^v.*/ - - python/tox: - name: Static checks - toxenv: static - filters: - <<: *ci_filters - - python/tox: - name: API compatibility check - toxenv: pidiff - filters: - <<: *ci_filters - - python/tox: - name: Build docs - toxenv: docs - # For pushing to gh-pages - context: pidiff-secrets - post-steps: - - run: scripts/push-docs - filters: &post_merge_filters - branches: - only: - - master - tags: - only: /^v.*/ - - python/release: - name: Release to PyPI - # For twine credentials - context: pidiff-secrets - # Only release if all tests passed - requires: - - Python 3.8 tests - - Static checks - filters: - <<: *post_merge_filters diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9c93d03 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + pull_request: + branches: [main] + workflow_call: {} + +jobs: + run-ci: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + + - name: Install dependencies + run: | + python -m pip install -U pip + pip install tox + + - name: Run tests + run: | + tox -s false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..66df9ca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release to PyPI + +on: + push: + tags: + - v** + workflow_dispatch: {} + +jobs: + run-ci: + uses: ./.github/workflows/ci.yml + + pypi-publish: + name: Upload release to PyPI + needs: [run-ci] + runs-on: ubuntu-22.04 + environment: + name: pypi + url: https://pypi.org/p/pidiff + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install -U pip + pip install build + + - name: Build distribution + run: | + python -mbuild + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1