From d6f39d37b5e904665a5a22bab3e5e852d35df44a Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 7 May 2023 00:22:08 -0400 Subject: [PATCH 1/2] Added PR multiarch Added python3.8-dev/build-essential to dockerfile Adds token to GH actions for GetTwitchDownloader --- .github/workflows/docker-pr.yml | 15 +++++++++++++-- .github/workflows/docker-release.yml | 2 ++ .github/workflows/docker.yml | 3 +++ Dockerfile | 2 +- docker-utils/GetTwitchDownloader.py | 3 ++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml index b2dfbe3..d66a2b2 100644 --- a/.github/workflows/docker-pr.yml +++ b/.github/workflows/docker-pr.yml @@ -23,5 +23,16 @@ jobs: name: "version.json" json: '{"type": "docker", "tag": "nightly", "commit": "${{ steps.vars.outputs.sha_short }}", "date": "${{ steps.date.outputs.date }}"}' dir: 'backend/' - - name: Build docker images - run: docker build . -t tzahi12345/youtubedl-material:nightly-pr \ No newline at end of file + - name: setup platform emulator + uses: docker/setup-qemu-action@v1 + - name: setup multi-arch docker build + uses: docker/setup-buildx-action@v1 + - name: build & push images + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm,linux/arm64/v8 + #platforms: linux/amd64 + push: false + tags: tzahi12345/youtubedl-material:nightly-pr \ No newline at end of file diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 3fd1716..e8dfea9 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -84,3 +84,5 @@ jobs: push: true tags: ${{ steps.docker-meta.outputs.tags }} labels: ${{ steps.docker-meta.outputs.labels }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e683353..5aa3f55 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -84,3 +84,6 @@ jobs: push: true tags: ${{ steps.docker-meta.outputs.tags }} labels: ${{ steps.docker-meta.outputs.labels }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/Dockerfile b/Dockerfile index b8a53de..856b58d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ FROM base as python WORKDIR /app COPY docker-utils/GetTwitchDownloader.py . RUN apt update && \ - apt install -y --no-install-recommends python3-minimal python-is-python3 python3-pip && \ + apt install -y --no-install-recommends python3-minimal python-is-python3 python3-pip python3.8-dev build-essential && \ apt clean && \ rm -rf /var/lib/apt/lists/* RUN pip install PyGithub requests diff --git a/docker-utils/GetTwitchDownloader.py b/docker-utils/GetTwitchDownloader.py index e236942..d32beb1 100644 --- a/docker-utils/GetTwitchDownloader.py +++ b/docker-utils/GetTwitchDownloader.py @@ -26,7 +26,8 @@ def getZipName(): def getLatestFileInRepo(repo, search_string): # Create an unauthenticated instance of the Github object - g = Github(os.environ.get('GH_TOKEN')) + gh_token = os.environ.get('GH_TOKEN') + g = Github(gh_token if gh_token else None) # ensure it's none if it's falsy # Replace with the repository owner and name repo = g.get_repo(repo) From 808c7e2112d3864d4e12c51b241892578744d669 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sun, 7 May 2023 01:18:28 -0400 Subject: [PATCH 2/2] Temporarily remove armv7 support Revert "Added python3.8-dev/build-essential to dockerfile" This reverts commit d90434c2404af67861a313eed122343d08ddd66d. Revert "Adds token to GH actions for GetTwitchDownloader" This reverts commit a4ca1abb7c9234d32242779f7f8efd520bfc7ecc. --- .github/workflows/docker-pr.yml | 2 +- .github/workflows/docker-release.yml | 4 +--- .github/workflows/docker.yml | 5 +---- Dockerfile | 2 +- docker-utils/GetTwitchDownloader.py | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml index d66a2b2..4287930 100644 --- a/.github/workflows/docker-pr.yml +++ b/.github/workflows/docker-pr.yml @@ -32,7 +32,7 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm,linux/arm64/v8 + platforms: linux/amd64,linux/arm64/v8 #platforms: linux/amd64 push: false tags: tzahi12345/youtubedl-material:nightly-pr \ No newline at end of file diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index e8dfea9..7677937 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -80,9 +80,7 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm,linux/arm64/v8 + platforms: linux/amd64,linux/arm64/v8 push: true tags: ${{ steps.docker-meta.outputs.tags }} labels: ${{ steps.docker-meta.outputs.labels }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5aa3f55..92697c2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -80,10 +80,7 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm,linux/arm64/v8 + platforms: linux/amd64,linux/arm64/v8 push: true tags: ${{ steps.docker-meta.outputs.tags }} labels: ${{ steps.docker-meta.outputs.labels }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/Dockerfile b/Dockerfile index 856b58d..b8a53de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ FROM base as python WORKDIR /app COPY docker-utils/GetTwitchDownloader.py . RUN apt update && \ - apt install -y --no-install-recommends python3-minimal python-is-python3 python3-pip python3.8-dev build-essential && \ + apt install -y --no-install-recommends python3-minimal python-is-python3 python3-pip && \ apt clean && \ rm -rf /var/lib/apt/lists/* RUN pip install PyGithub requests diff --git a/docker-utils/GetTwitchDownloader.py b/docker-utils/GetTwitchDownloader.py index d32beb1..e236942 100644 --- a/docker-utils/GetTwitchDownloader.py +++ b/docker-utils/GetTwitchDownloader.py @@ -26,8 +26,7 @@ def getZipName(): def getLatestFileInRepo(repo, search_string): # Create an unauthenticated instance of the Github object - gh_token = os.environ.get('GH_TOKEN') - g = Github(gh_token if gh_token else None) # ensure it's none if it's falsy + g = Github(os.environ.get('GH_TOKEN')) # Replace with the repository owner and name repo = g.get_repo(repo)