-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: start improving project structure
- Loading branch information
Showing
11 changed files
with
1,268 additions
and
342 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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 |
---|---|---|
|
@@ -2,27 +2,54 @@ name: CI | |
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
main: | ||
name: Test and release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Setup poetry cache | ||
id: cached-poetry | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ runner.os }} | ||
- name: Install poetry | ||
if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Setup venv cache | ||
id: cached-venv | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
if: steps.cached-venv.outputs.cache-hit != 'true' | ||
run: poetry install | ||
- name: Check formatting | ||
run: poetry run black --check pynbs | ||
- name: Release | ||
if: | | ||
github.repository == 'OpenNBS/pynbs' | ||
&& github.event_name == 'push' | ||
&& github.ref == 'refs/heads/main' | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <[email protected]>" --prerelease |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"bungcip.better-toml" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"python.formatting.provider": "black", | ||
"python.languageServer": "Pylance", | ||
"python.linting.enabled": false, | ||
"python.linting.pylintEnabled": false, | ||
"python.linting.banditEnabled": false, | ||
"python.linting.flake8Enabled": false, | ||
"python.linting.mypyEnabled": false, | ||
"python.linting.prospectorEnabled": false, | ||
"python.linting.pycodestyleEnabled": false, | ||
"python.linting.pydocstyleEnabled": false, | ||
"python.linting.pylamaEnabled": false, | ||
"[python]": { | ||
"editor.tabSize": 4, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": false, | ||
"editor.formatOnPaste": false, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
} | ||
} |
Oops, something went wrong.