Skip to content

Commit b3f0637

Browse files
committed
Condense UI; Update Github release action
1 parent 509417c commit b3f0637

File tree

5 files changed

+65
-21
lines changed

5 files changed

+65
-21
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,56 @@ name: Release
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: 'Version to release (e.g., v0.1.9)'
8-
required: true
9-
default: 'v0.1.9'
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'py-tui/pyproject.toml'
1010

1111
jobs:
1212
release:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Check if version changed
20+
id: version_check
21+
run: |
22+
# Get current version
23+
CURRENT_VERSION=$(grep '^version = ' py-tui/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
24+
25+
# Get previous version (if push event)
26+
if [ "${{ github.event_name }}" = "push" ]; then
27+
PREVIOUS_VERSION=$(git show HEAD~1:py-tui/pyproject.toml | grep '^version = ' | sed 's/version = "\(.*\)"/\1/' || echo "")
28+
if [ "$CURRENT_VERSION" = "$PREVIOUS_VERSION" ]; then
29+
echo "Version unchanged, skipping release"
30+
echo "changed=false" >> $GITHUB_OUTPUT
31+
exit 0
32+
fi
33+
fi
34+
35+
# Check if tag already exists
36+
if git tag --list | grep -q "^v$CURRENT_VERSION$"; then
37+
echo "Tag v$CURRENT_VERSION already exists, skipping release"
38+
echo "changed=false" >> $GITHUB_OUTPUT
39+
exit 0
40+
fi
41+
42+
echo "Version changed to $CURRENT_VERSION"
43+
echo "changed=true" >> $GITHUB_OUTPUT
44+
echo "version=v$CURRENT_VERSION" >> $GITHUB_OUTPUT
45+
echo "raw_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
1646
1747
- name: Create Release
48+
if: steps.version_check.outputs.changed == 'true'
1849
uses: actions/create-release@v1
1950
env:
2051
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2152
with:
22-
tag_name: ${{ github.event.inputs.version }}
23-
release_name: Release ${{ github.event.inputs.version }}
53+
tag_name: ${{ steps.version_check.outputs.version }}
54+
release_name: Release ${{ steps.version_check.outputs.version }}
2455
body: |
2556
## Python TUI Installation Instructions
2657

py-tui/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "frixa-anitrack"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Add your description here"
55
readme = "README.md"
66
authors = [

py-tui/src/frixa_anitrack/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ class TorrentResponse(TypedDict):
4848

4949
class WatchButton(Button):
5050
def __init__(self, magnet: str):
51-
super().__init__("PLAY", classes="watch-btn")
51+
super().__init__("", classes="watch-btn")
5252
self.magnet = magnet
53-
self.compact = False
53+
self.compact = True
5454

5555

5656
class SearchBox(Horizontal):
57-
def __init__(self, **kwargs) -> None:
57+
def __init__(self, **kwargs: Any) -> None:
5858
super().__init__(**kwargs)
5959
self.current_search_task: Optional[asyncio.Task[None]] = None
6060

py-tui/src/frixa_anitrack/styles.tcss

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,43 @@ Screen {
5656
Button {
5757
background: #cba6f7;
5858
color: #ffffff;
59-
padding: 0 2;
60-
min-width: 8;
61-
margin: 0 1;
62-
width: 10%;
59+
border: none;
60+
min-width: 0;
61+
width: 3;
62+
height: 1;
63+
content-align: center middle;
6364
}
6465

6566
Button:focus {
6667
background:rgb(121, 72, 182);
6768
color: rgb(121, 72, 182);
6869
}
6970

71+
.watch-btn {
72+
margin: 0 1;
73+
width: 5;
74+
}
75+
7076
.title-col {
71-
padding: 1 1;
72-
width: 65%;
77+
padding: 0 0;
78+
width: 1fr;
79+
text-align: left;
7380
color: #f5c2e7;
7481
color: #a6e3a1;
7582
}
7683

7784
.size-col {
78-
padding: 1 1;
85+
padding: 0 0;
86+
margin: 0 0;
87+
# width: auto;
88+
text-align: center;
7989
width: 10%;
8090
}
8191

8292
.date-col {
83-
padding: 1 1;
93+
padding: 0 0;
94+
margin: 0 1;
95+
# width: auto;
96+
text-align: right;
8497
width: 15%;
85-
}
98+
}

py-tui/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)