From f8119bad4e99216f7e58bf26b6b96a57ef692678 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 16:35:21 -0500 Subject: [PATCH 1/7] test --- .github/workflows/docker-publish.yml | 5 +++-- Dockerfile | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2d4b3c1..98ccd68 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -34,7 +34,7 @@ jobs: # Login into GitHub Container Registry except on PR - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' + # if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -57,6 +57,7 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} + # push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} context: . diff --git a/Dockerfile b/Dockerfile index d78eec7..53e271f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ ARG TWITCHDOWNLOADER_VERSION="1.55.0" # Build stage -FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS build +FROM golang:1.22-bookworm AS build WORKDIR /app COPY . . RUN make build_server build_worker # Tools stage -FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS tools +FROM debian:bookworm-slim AS tools WORKDIR /tmp RUN apt-get update && apt-get install -y --no-install-recommends \ unzip git ca-certificates curl \ From b6f55ad08b9f069e2a1b2f72561fd242c32b79da Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 16:59:48 -0500 Subject: [PATCH 2/7] update tdl logic for arm64 --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 53e271f..47fd020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,12 +15,13 @@ unzip git ca-certificates curl \ # Download TwitchDownloader for the correct platform ARG TWITCHDOWNLOADER_VERSION -ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux -RUN if [ "$BUILDPLATFORM" = "arm64" ]; then \ - export TWITCHDOWNLOADER_URL=${TWITCHDOWNLOADER_URL}Arm; \ - fi && \ - export TWITCHDOWNLOADER_URL=${TWITCHDOWNLOADER_URL}-x64.zip && \ - echo "Download URL: $TWITCHDOWNLOADER_URL" && \ +ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip + +RUN if [ "$ARCH" = "arm64" ]; then + export TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip + fi + +RUN echo "Download URL: $TWITCHDOWNLOADER_URL" && \ curl -L $TWITCHDOWNLOADER_URL -o twitchdownloader.zip && \ unzip twitchdownloader.zip && \ rm twitchdownloader.zip From 9c0f2c30bc2f915bbf82001f287d52e621788589 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 17:03:38 -0500 Subject: [PATCH 3/7] fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 47fd020..5324db6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG TWITCHDOWNLOADER_VERSION ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip RUN if [ "$ARCH" = "arm64" ]; then - export TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip + export TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip fi RUN echo "Download URL: $TWITCHDOWNLOADER_URL" && \ From 20544958513a55da7a0180aeeae0bf2c64b6aecd Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 17:18:47 -0500 Subject: [PATCH 4/7] fix --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5324db6..d7d4ffc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,11 +17,10 @@ unzip git ca-certificates curl \ ARG TWITCHDOWNLOADER_VERSION ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip -RUN if [ "$ARCH" = "arm64" ]; then - export TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip - fi - -RUN echo "Download URL: $TWITCHDOWNLOADER_URL" && \ +RUN if [ "$ARCH" = "arm64" ]; then \ + TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip \ + fi && \ + echo "Download URL: $TWITCHDOWNLOADER_URL" && \ curl -L $TWITCHDOWNLOADER_URL -o twitchdownloader.zip && \ unzip twitchdownloader.zip && \ rm twitchdownloader.zip From 65e6451313a21641a491391f5a607f2d43abc397 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 17:21:50 -0500 Subject: [PATCH 5/7] fix --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7d4ffc..f3ae9f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,15 @@ unzip git ca-certificates curl \ ARG TWITCHDOWNLOADER_VERSION ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip -RUN if [ "$ARCH" = "arm64" ]; then \ - TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip \ + +RUN if [ "$BUILDPLATFORM" = "arm64" ]; then \ +TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip; \ fi && \ echo "Download URL: $TWITCHDOWNLOADER_URL" && \ curl -L $TWITCHDOWNLOADER_URL -o twitchdownloader.zip && \ unzip twitchdownloader.zip && \ rm twitchdownloader.zip + RUN git clone --depth 1 https://github.com/xenova/chat-downloader.git # Production stage From 6abb1b29c8bb270b62680f23d368e3adf7a97395 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 15 Aug 2024 17:57:04 -0500 Subject: [PATCH 6/7] use uname --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f3ae9f0..d44f1e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ARG TWITCHDOWNLOADER_VERSION ENV TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-Linux-x64.zip -RUN if [ "$BUILDPLATFORM" = "arm64" ]; then \ +RUN if [ "$(uname -m)" = "aarch64" ]; then \ TWITCHDOWNLOADER_URL=https://github.com/lay295/TwitchDownloader/releases/download/${TWITCHDOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCHDOWNLOADER_VERSION}-LinuxArm64.zip; \ fi && \ echo "Download URL: $TWITCHDOWNLOADER_URL" && \ From 5049e34c71dddb2d8fee6f480593d5c24877591d Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 16 Aug 2024 17:56:10 -0500 Subject: [PATCH 7/7] remove temp push logic --- .github/workflows/docker-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 98ccd68..2d4b3c1 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -34,7 +34,7 @@ jobs: # Login into GitHub Container Registry except on PR - name: Log into registry ${{ env.REGISTRY }} - # if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -57,7 +57,6 @@ jobs: uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 - # push: ${{ github.event_name != 'pull_request' }} - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} context: .