Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce302e4d45 | |||
| 19589c9463 | |||
| 3d9506b14e | |||
| 23b87278b2 |
68
.gitea/workflows/build.yml
Normal file
68
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["**"]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
VROBBLER_DATABASE_URL: sqlite:///test.db
|
||||||
|
VROBBLER_USDA_API_KEY: ${{ vars.VROBBLER_USDA_API_KEY }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Cache pip/poetry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/pip
|
||||||
|
~/.cache/pypoetry
|
||||||
|
key: ${{ runner.os }}-py311-${{ hashFiles('**/poetry.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-py311-
|
||||||
|
|
||||||
|
- name: Install Poetry
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install poetry
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
cp vrobbler.conf.test vrobbler.conf
|
||||||
|
poetry install --with test
|
||||||
|
|
||||||
|
- name: Pytest with coverage
|
||||||
|
run: |
|
||||||
|
poetry run pytest -n 5 --cov-report term:skip-covered --cov=vrobbler tests
|
||||||
|
|
||||||
|
- name: Notify success (ntfy)
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
curl -fsS \
|
||||||
|
-H "Title: vrobbler CI success" \
|
||||||
|
-H "Priority: low" \
|
||||||
|
-H "Tags: success,vrobbler" \
|
||||||
|
-H "Actions: view, Changes, ${{ gitea.server_url }}/${{ gitea.repository }}/commit/${{ gitea.sha }}; view, Build, ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
|
||||||
|
-d "✅ Build succeeded: ${{ gitea.repository }} @ ${{ gitea.sha }}" \
|
||||||
|
https://ntfy.unbl.ink/drone
|
||||||
|
|
||||||
|
- name: Notify failure (ntfy)
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
curl -fsS \
|
||||||
|
-H "Title: vrobbler CI failure" \
|
||||||
|
-H "Priority: high" \
|
||||||
|
-H "Tags: failure,vrobbler" \
|
||||||
|
-H "Actions: view, Changes, ${{ gitea.server_url }}/${{ gitea.repository }}/commit/${{ gitea.sha }}; view, Build, ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
|
||||||
|
-d "❌ Build failed: ${{ gitea.repository }} @ ${{ gitea.sha }}" \
|
||||||
|
https://ntfy.unbl.ink/drone
|
||||||
@ -1,10 +1,8 @@
|
|||||||
name: build & deploy
|
name: deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["**"]
|
|
||||||
tags: ["*"]
|
tags: ["*"]
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@ -22,7 +20,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
# Cache pip + Poetry caches (rough equivalent to your mounted pip_cache)
|
|
||||||
- name: Cache pip/poetry
|
- name: Cache pip/poetry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@ -47,7 +44,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
poetry run pytest -n 5 --cov-report term:skip-covered --cov=vrobbler tests
|
poetry run pytest -n 5 --cov-report term:skip-covered --cov=vrobbler tests
|
||||||
|
|
||||||
# Notifications (success/failure) for the test job
|
|
||||||
- name: Notify success (ntfy)
|
- name: Notify success (ntfy)
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
@ -71,8 +67,6 @@ jobs:
|
|||||||
https://ntfy.unbl.ink/drone
|
https://ntfy.unbl.ink/drone
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
# Only deploy on tags (equivalent to Drone when: ref: refs/tags/*)
|
|
||||||
if: startsWith(gitea.ref, 'refs/tags/')
|
|
||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
@ -97,10 +91,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build package with commit info
|
- name: Build package with commit info
|
||||||
run: |
|
run: |
|
||||||
# Write commit to _commit.py before build
|
|
||||||
echo "commit = '$(echo ${{ gitea.sha }} | cut -c1-8)'" > vrobbler/_commit.py
|
echo "commit = '$(echo ${{ gitea.sha }} | cut -c1-8)'" > vrobbler/_commit.py
|
||||||
poetry build
|
poetry build
|
||||||
# Restore original _commit.py
|
|
||||||
git checkout vrobbler/_commit.py
|
git checkout vrobbler/_commit.py
|
||||||
|
|
||||||
- name: Copy wheel to server and deploy
|
- name: Copy wheel to server and deploy
|
||||||
@ -124,9 +116,9 @@ jobs:
|
|||||||
mkdir -p /var/lib/vrobbler
|
mkdir -p /var/lib/vrobbler
|
||||||
echo "${{ gitea.sha }}" | cut -c1-8 > /var/lib/vrobbler/commit.txt
|
echo "${{ gitea.sha }}" | cut -c1-8 > /var/lib/vrobbler/commit.txt
|
||||||
pip uninstall -y vrobbler
|
pip uninstall -y vrobbler
|
||||||
|
rm -f /var/lib/vrobbler/dist/*.whl
|
||||||
pip install /var/lib/vrobbler/dist/*.whl
|
pip install /var/lib/vrobbler/dist/*.whl
|
||||||
python -c "import vrobbler; print(f'vrobbler {vrobbler.__version__} installed OK')"
|
python -c "import vrobbler; print(f'vrobbler {vrobbler.__version__} installed OK')"
|
||||||
rm -f /var/lib/vrobbler/dist/*.whl
|
|
||||||
vrobbler migrate
|
vrobbler migrate
|
||||||
vrobbler collectstatic --noinput
|
vrobbler collectstatic --noinput
|
||||||
immortalctl restart vrobbler-celery && immortalctl restart vrobbler-celerybeat && immortalctl restart vrobbler
|
immortalctl restart vrobbler-celery && immortalctl restart vrobbler-celerybeat && immortalctl restart vrobbler
|
||||||
36
PROJECT.org
36
PROJECT.org
@ -93,7 +93,7 @@ fetching and simple saving.
|
|||||||
:LOGBOOK:
|
:LOGBOOK:
|
||||||
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
||||||
:END:
|
:END:
|
||||||
* Backlog [0/13] :vrobbler:project:personal:
|
* Backlog [-2/11] :vrobbler:project:personal:
|
||||||
** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment:
|
** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85
|
:ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85
|
||||||
@ -489,6 +489,40 @@ whatever time KoReader reports, we need to know, given the date and the user
|
|||||||
profile's historic timezone, how many hours to adjust the KoReader time to get
|
profile's historic timezone, how many hours to adjust the KoReader time to get
|
||||||
to GMT to save it in the database.
|
to GMT to save it in the database.
|
||||||
|
|
||||||
|
* Version 39.3 [2/2]
|
||||||
|
** DONE [#A] Issue found when doing a release :bug:tooling:release:cicd:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: a8fc3ec9-74ec-4190-8ac2-62cd8a33e828
|
||||||
|
:END:
|
||||||
|
|
||||||
|
*** Description
|
||||||
|
#+begin_src sh
|
||||||
|
err: ERROR: Cannot install vrobbler 0.16.1 (from /var/lib/vrobbler/dist/vrobbler-0.16.1-py3-none-any.whl) and vrobbler 38.0 (from /var/lib/vrobbler/dist/vrobbler-38.0-py3-none-any.whl) because these package versions have conflicting dependencies.
|
||||||
|
out: The conflict is caused by:
|
||||||
|
out: The user requested vrobbler 0.16.1 (from /var/lib/vrobbler/dist/vrobbler-0.16.1-py3-none-any.whl)
|
||||||
|
out: The user requested vrobbler 38.0 (from /var/lib/vrobbler/dist/vrobbler-38.0-py3-none-any.whl)
|
||||||
|
out: To fix this you could try to:
|
||||||
|
out: 1. loosen the range of package versions you've specified
|
||||||
|
out: 2. remove package versions to allow pip attempt to solve the dependency conflict
|
||||||
|
err: ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
|
||||||
|
2026/06/01 14:15:00 Process exited with status 1
|
||||||
|
failed to remove container: Error response from daemon: removal of container 3fe0eaf032c5518aca4ab71734b52bda7c54ed406136b82136ab7155bf5ff3c1 is already in progress
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** DONE [#A] Fix deploy actions running twice :bug:tooling:cicd:
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: aa56f2a6-2b61-4ddf-9e27-9eadcddf8412
|
||||||
|
:END:
|
||||||
|
|
||||||
|
*** Description
|
||||||
|
|
||||||
|
Turns out we're now running the build-deploy action twice, once on branch push
|
||||||
|
and once on tag push.
|
||||||
|
|
||||||
|
We should do builds on each push and build and deploys only when a new tag is
|
||||||
|
detected.
|
||||||
|
|
||||||
|
|
||||||
* Version 39.2 [2/2]
|
* Version 39.2 [2/2]
|
||||||
** DONE [#B] Releases do not pin commit to the repo for display :bug:tooling:releases:
|
** DONE [#B] Releases do not pin commit to the repo for display :bug:tooling:releases:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "vrobbler"
|
name = "vrobbler"
|
||||||
version = "39.2"
|
version = "39.3"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Colin Powell <colin@unbl.ink>"]
|
authors = ["Colin Powell <colin@unbl.ink>"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user