-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
13 changed files
with
349 additions
and
26 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 @@ | ||
github: [snopoke] |
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,32 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install Poetry | ||
uses: Gr1N/setup-poetry@v8 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
# Explicitly also install tox-gh-actions to prevent tests from using system interpreter | ||
run: | | ||
poetry install --no-interaction= | ||
pip install tox-gh-actions | ||
- name: Run tox | ||
run: tox |
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,39 @@ | ||
on: | ||
workflow_dispatch: | ||
branches: [main] | ||
release: | ||
types: | ||
- published | ||
|
||
name: PyPI Publish | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install Poetry | ||
uses: Gr1N/setup-poetry@v8 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
- name: Checks | ||
run: | | ||
poetry --version | ||
poetry check --no-interaction | ||
- name: Install deps | ||
run: poetry install --no-interaction | ||
- name: Run tests | ||
run: poetry run pytest -v | ||
- name: Publish to PyPI | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build |
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,64 @@ | ||
on: | ||
workflow_dispatch: | ||
branches: [main] | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Create Release | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
autorelease: | ||
name: Create Release | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install Poetry | ||
uses: Gr1N/setup-poetry@v8 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
- name: Checks | ||
run: | | ||
poetry --version | ||
poetry check --no-interaction | ||
- name: Add version to environment vars | ||
run: | | ||
PROJECT_VERSION=$(poetry version --short) | ||
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | ||
- name: Check if tag version matches project version | ||
run: | | ||
TAG=$(git describe HEAD --tags --abbrev=0) | ||
echo $TAG | ||
echo $PROJECT_VERSION | ||
if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then exit 1; fi | ||
- name: Checks | ||
run: | | ||
poetry --version | ||
poetry check --no-interaction | ||
- name: Install deps | ||
run: poetry install --no-interaction | ||
- name: Run tests | ||
run: poetry run pytest -v | ||
- name: Build | ||
run: poetry build | ||
- name: Create Release Draft | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: Release ${{ github.ref }} | ||
draft: true | ||
generate_release_notes: true | ||
files: | | ||
dist/taskbadger-${{env.PROJECT_VERSION}}-py3-none-any.whl | ||
dist/taskbadger-${{env.PROJECT_VERSION}}.tar.gz |
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,3 +2,5 @@ | |
.idea/ | ||
.ruff_cache/ | ||
.pytest_cache/ | ||
.tox/ | ||
__pycache__ |
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 |
---|---|---|
|
@@ -21,4 +21,6 @@ repos: | |
rev: v0.1.4 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- id: ruff-format |
File renamed without changes.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.