-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
218 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
name: Test code | ||
runs-on: ${{ matrix.os }} | ||
needs: is-duplicate | ||
if: ${{ needs.is-duplicate.outputs.should_skip != 'true' }} | ||
if: needs.is-duplicate.outputs.should_skip != 'true' | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
@@ -52,65 +52,80 @@ jobs: | |
- name: Test with Tox | ||
run: tox | ||
|
||
test-dist: | ||
name: Test distribution | ||
runs-on: ubuntu-latest | ||
build-wheels: | ||
name: Build wheels | ||
runs-on: ${{ matrix.os }} | ||
needs: is-duplicate | ||
if: ${{ needs.is-duplicate.outputs.should_skip != 'true' }} | ||
if: | | ||
needs.is-duplicate.outputs.should_skip != 'true' && | ||
startsWith(github.ref, 'refs/heads/develop') | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- name: Upload artefacts to GitHub | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
python-version: '3.x' | ||
name: dist-packages | ||
path: wheelhouse/*.whl | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade build twine | ||
build-sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
needs: is-duplicate | ||
if: | | ||
needs.is-duplicate.outputs.should_skip != 'true' && | ||
startsWith(github.ref, 'refs/heads/develop') | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Build and test with Twine | ||
- name: Build sdist | ||
run: | | ||
python -m build | ||
twine check dist/* | ||
pipx run build --sdist | ||
pipx run twine check dist/* | ||
- name: Upload artefacts to GitHub | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist-packages | ||
path: dist/*.tar.gz | ||
|
||
publish-to-test-pypi: | ||
name: Publish to TestPyPI | ||
environment: staging | ||
runs-on: ubuntu-latest | ||
needs: [test-code] | ||
needs: [test-code, build-sdist, build-wheels] | ||
if: | | ||
!failure() && | ||
startsWith(github.ref, 'refs/tags/') | ||
github.event_name == 'push' && | ||
startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Download artefacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
submodules: recursive | ||
name: dist-packages | ||
path: dist | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Publish to TestPyPI | ||
uses: pypa/[email protected] | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade build twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: '__token__' | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python -m build | ||
twine upload --repository testpypi dist/* | ||
repository-url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
print-hash: true | ||
|
||
publish-to-pypi: | ||
name: Publish to PyPI | ||
|
@@ -119,28 +134,18 @@ jobs: | |
needs: [publish-to-test-pypi] | ||
if: | | ||
!failure() && | ||
startsWith(github.ref, 'refs/tags/') | ||
github.event_name == 'push' && | ||
startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Download artefacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
submodules: recursive | ||
name: dist-packages | ||
path: dist | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Publish to test PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade build twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: '__token__' | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python -m build | ||
twine upload dist/* | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
print-hash: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: 38b88246ccc552bffaaf54259d064beeee434539 # frozen: v4.0.1 | ||
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-executables-have-shebangs | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: dcd740bc0ebaf2b3d43e59a0060d157c97de13f3 # frozen: 3.9.2 | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 343c49ab887fa4e5724ceb86c9c3678e647c94c2 # frozen: v0.0.262 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/PyCQA/pylint | ||
rev: 591a23adcfdd2fe20b8cfdb9e4e07772c8f454f8 # frozen: v2.10.2 | ||
- id: ruff | ||
|
||
- repo: https://github.com/psf/black | ||
rev: bf7a16254ec96b084a6caf3d435ec18f0f245cc7 # frozen: 23.3.0 | ||
hooks: | ||
- id: pylint | ||
- id: black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.