Skip to content

Commit 044f9f6

Browse files
committed
upgrade pyaction to 0.8.1
1 parent a34b822 commit 044f9f6

File tree

5 files changed

+253
-70
lines changed

5 files changed

+253
-70
lines changed

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# Set the base image to the minimal Python 3.12 slim image
1+
# Setting the base-image
22
FROM python:3.12-slim
33

44
# Copy only the necessary binaries from uv
55
COPY --from=ghcr.io/astral-sh/uv:0.5.1 /uv /uvx /bin/
66

7-
# Set environment variable early to take advantage of layer caching
8-
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"
9-
107
# Set the working directory to /action
118
WORKDIR /action
129

13-
# importing the action
10+
# Import the action
1411
COPY . .
1512

16-
# running the script.sh
17-
RUN if [ -f script.sh ]; then sh script.sh; fi
13+
# Run the pre-script.sh
14+
RUN [ -f pre-script.sh ] && sh pre-script.sh || true
15+
16+
# Install action dependencies
17+
RUN uv sync --no-install-project --no-cache
1818

19-
# Install project dependencies first for better caching
20-
RUN uv sync --frozen --no-cache
19+
# running the post-script.sh
20+
RUN [ -f post-script.sh ] && sh post-script.sh || true
2121

2222
# Specify the command to run main.py with uv
23-
CMD [ "uv", "run", "main.py" ]
23+
CMD [ "uv", "run", "/action/main.py" ]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/checkout@v4
3232

3333
- name: Updating the badge
34-
uses: lnxpy/pypi-chart-badge@v1.1
34+
uses: lnxpy/pypi-chart-badge@v1.2
3535
with:
3636
package_name: '<PACKAGE-NAME>'
3737

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33

44
from pyaction import PyAction
5-
from pyaction.workflow import annotations as AN
5+
from pyaction.workflow import annotations as A
66

77
from chart import Badge
88
from pypi import PyPI
@@ -21,13 +21,13 @@ def get_or_create_path(path: str) -> str:
2121
"""
2222

2323
if not os.path.exists(path):
24-
AN.warning(f"Couldn't find `{path}` path in the repo. Creating it!")
24+
A.warning(f"Couldn't find `{path}` path in the repo. Creating it!")
2525
os.makedirs(path)
2626

2727
return path
2828

2929

30-
@workflow.action()
30+
@workflow.action
3131
def action(
3232
package_name: str,
3333
badge_width: int,

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
[project]
22
name = "pypi-chart-badge"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
description = "PyPI Chart Badge Generator"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
88
"kaleido==0.2.1",
99
"pandas==2.2.1",
1010
"plotly==5.24.1",
11-
"pyaction==0.7.2",
11+
"pyaction==0.8.1",
1212
"requests==2.32.3",
1313
]
14+
15+
[project.optional-dependencies]
16+
cli = ["pyaction[cli]==0.8.1"]

0 commit comments

Comments
 (0)