Skip to content

Commit b4b9fe8

Browse files
committed
Configurar Docker y workflows para WTelegramClient submodule + script de cambio completo
1 parent 73bd877 commit b4b9fe8

5 files changed

Lines changed: 437 additions & 9 deletions

File tree

.github/workflows/buildrelease.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
steps:
5757
- name: '📄 Checkout'
5858
uses: actions/checkout@v4
59+
with:
60+
submodules: recursive
5961

6062
- name: '🔧 Setup .NET 10'
6163
uses: actions/setup-dotnet@v4

.github/workflows/docker-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
1517

1618
- name: Generate version
1719
id: version
@@ -34,7 +36,7 @@ jobs:
3436
run: |
3537
VERSION=${{ steps.version.outputs.version }}
3638
echo "Building full image with FFmpeg support..."
37-
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
39+
docker build . -f ./TelegramDownloader/Dockerfile \
3840
--build-arg VERSION=$VERSION \
3941
--build-arg INCLUDE_FFMPEG=true \
4042
--tag ghcr.io/mateof/telegramfilemanager:dev_$VERSION \
@@ -46,7 +48,7 @@ jobs:
4648
run: |
4749
VERSION=${{ steps.version.outputs.version }}
4850
echo "Building lite image without FFmpeg..."
49-
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
51+
docker build . -f ./TelegramDownloader/Dockerfile \
5052
--build-arg VERSION=$VERSION \
5153
--build-arg INCLUDE_FFMPEG=false \
5254
--tag ghcr.io/mateof/telegramfilemanager:dev_$VERSION-lite \

.github/workflows/release-docker-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
2224

2325
- name: Extract version from tag
2426
id: version
@@ -42,7 +44,7 @@ jobs:
4244
run: |
4345
VERSION=${{ steps.version.outputs.version }}
4446
echo "Building full image with FFmpeg support..."
45-
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
47+
docker build . -f ./TelegramDownloader/Dockerfile \
4648
--build-arg VERSION=$VERSION \
4749
--build-arg INCLUDE_FFMPEG=true \
4850
--tag ghcr.io/mateof/telegramfilemanager:${{github.ref_name}} \
@@ -54,7 +56,7 @@ jobs:
5456
run: |
5557
VERSION=${{ steps.version.outputs.version }}
5658
echo "Building lite image without FFmpeg..."
57-
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
59+
docker build . -f ./TelegramDownloader/Dockerfile \
5860
--build-arg VERSION=$VERSION \
5961
--build-arg INCLUDE_FFMPEG=false \
6062
--tag ghcr.io/mateof/telegramfilemanager:${{github.ref_name}}-lite \

TelegramDownloader/Dockerfile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,28 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
2222
ARG BUILD_CONFIGURATION=Release
2323
ARG VERSION=0.0.0.0
2424
WORKDIR /src
25-
COPY ["TelegramDownloader.csproj", "."]
26-
RUN dotnet restore "TelegramDownloader.csproj"
27-
COPY . .
28-
WORKDIR "/src/."
25+
26+
# Copy submodule (WTelegramClient) first
27+
COPY ["libs/WTelegramClient/src/WTelegramClient.csproj", "libs/WTelegramClient/src/"]
28+
COPY ["libs/WTelegramClient/generator/MTProtoGenerator.csproj", "libs/WTelegramClient/generator/"]
29+
30+
# Copy main project
31+
COPY ["TelegramDownloader/TelegramDownloader.csproj", "TelegramDownloader/"]
32+
33+
# Restore all projects
34+
RUN dotnet restore "TelegramDownloader/TelegramDownloader.csproj"
35+
36+
# Copy all source files
37+
COPY libs/WTelegramClient/ libs/WTelegramClient/
38+
COPY TelegramDownloader/ TelegramDownloader/
39+
40+
WORKDIR "/src/TelegramDownloader"
2941
RUN dotnet build "./TelegramDownloader.csproj" -c $BUILD_CONFIGURATION -o /app/build
3042

3143
FROM build AS publish
3244
ARG BUILD_CONFIGURATION=Release
3345
ARG VERSION=0.0.0.0
46+
WORKDIR "/src/TelegramDownloader"
3447
RUN dotnet publish "./TelegramDownloader.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false,InformationalVersion=$VERSION
3548

3649
FROM base AS final
@@ -40,7 +53,7 @@ WORKDIR /app
4053
RUN apk add --no-cache python3 py3-pip && \
4154
ln -sf /usr/bin/python3 /usr/bin/python
4255

43-
COPY ./WebDav /app/WebDav
56+
COPY TelegramDownloader/WebDav /app/WebDav
4457

4558
# Create venv and install dependencies in single layer
4659
RUN python3 -m venv /app/venv && \

0 commit comments

Comments
 (0)