-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add poetry * add codespell workflow * fix findings * update lock file * use python v3.8 * remove setup.py etc * update release workflow * Revert "fix findings" This reverts commit 1e4ae0f. * Revert "add codespell workflow" This reverts commit 194694b. * remove codespell * update test workflow * update dependencies * update coverage command * update coverage command * Update build.yml * Rename build.yml to test.yml
- Loading branch information
Showing
10 changed files
with
673 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,26 +1,52 @@ | ||
name: Upload Python Package | ||
name: Release | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
release: | ||
types: [published] | ||
types: | ||
- published | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
|
||
jobs: | ||
deploy: | ||
release: | ||
name: Releasing to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: PyPI | ||
url: https://pypi.org/p/PyViCare | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: "poetry" | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_APITOKEN }} | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install dependencies | ||
run: poetry install --no-interaction | ||
- name: 🏗 Set package version | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
version="${{ github.event.release.tag_name }}" | ||
version="${version,,}" | ||
version="${version#v}" | ||
poetry version --no-interaction "${version}" | ||
- name: 🏗 Build package | ||
run: poetry build --no-interaction | ||
- name: 🚀 Publish to PyPi | ||
uses: pypa/[email protected] | ||
with: | ||
verbose: true | ||
print-hash: true | ||
password: ${{ secrets.PYPI_APITOKEN }} |
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,45 @@ | ||
name: Test | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.11" | ||
|
||
jobs: | ||
pytest: | ||
name: Python ${{ matrix.python }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ matrix.python }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: "poetry" | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Run pytest | ||
run: poetry run pytest --cov PyViCare | ||
- name: ⬆️ Upload coverage artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: coverage-${{ matrix.python }} | ||
path: .coverage |
Oops, something went wrong.