1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-17 01:48:29 +00:00

Cache armv7l requirements and move to its own job

Authored by: bashonly
This commit is contained in:
bashonly 2025-08-13 06:53:02 -05:00
parent b6030e71ae
commit 7585f16996
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0
4 changed files with 89 additions and 30 deletions

View File

@ -15,6 +15,9 @@ on:
linux: linux:
default: true default: true
type: boolean type: boolean
linux_armv7l:
default: true
type: boolean
musllinux: musllinux:
default: true default: true
type: boolean type: boolean
@ -53,7 +56,11 @@ on:
default: true default: true
type: boolean type: boolean
linux: linux:
description: yt-dlp_linux, yt-dlp_linux.zip, yt-dlp_linux_aarch64, yt-dlp_linux_aarch64.zip, yt-dlp_linux_armv7l description: yt-dlp_linux, yt-dlp_linux.zip, yt-dlp_linux_aarch64, yt-dlp_linux_aarch64.zip
default: true
type: boolean
linux_armv7l:
description: yt-dlp_linux_armv7l
default: true default: true
type: boolean type: boolean
musllinux: musllinux:
@ -148,16 +155,8 @@ jobs:
- exe: yt-dlp_linux_aarch64 - exe: yt-dlp_linux_aarch64
platform: aarch64 platform: aarch64
runner: ubuntu-24.04-arm runner: ubuntu-24.04-arm
- exe: yt-dlp_linux_armv7l
platform: armv7l
runner: ubuntu-24.04-arm
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.platform == 'armv7l'
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm/v7
- name: Build executable - name: Build executable
env: env:
EXE_NAME: ${{ matrix.exe }} EXE_NAME: ${{ matrix.exe }}
@ -172,7 +171,7 @@ jobs:
docker compose down docker compose down
sudo chown "${USER}:docker" ~/build/${{ matrix.exe }} sudo chown "${USER}:docker" ~/build/${{ matrix.exe }}
- name: Verify --update-to - name: Verify --update-to
if: vars.UPDATE_TO_VERIFICATION && matrix.platform != 'armv7l' if: vars.UPDATE_TO_VERIFICATION
run: | run: |
chmod +x ~/build/${{ matrix.exe }} chmod +x ~/build/${{ matrix.exe }}
mkdir -p ~/testing mkdir -p ~/testing
@ -181,20 +180,6 @@ jobs:
~/testing/${{ matrix.exe }}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04 ~/testing/${{ matrix.exe }}_downgraded -v --update-to yt-dlp/yt-dlp@2023.03.04
downgraded_version="$(~/testing/${{ matrix.exe }}_downgraded --version)" downgraded_version="$(~/testing/${{ matrix.exe }}_downgraded --version)"
[[ "$version" != "$downgraded_version" ]] [[ "$version" != "$downgraded_version" ]]
# TEMPORARY:
~/build/${{ matrix.exe }} -v --print-traffic -o- --impersonate chrome "https://tls.browserleaks.com/json" | cat
- name: Verify --update-to for armv7l
if: vars.UPDATE_TO_VERIFICATION && matrix.platform == 'armv7l'
env:
EXE_NAME: ${{ matrix.exe }}
CHANNEL: ${{ inputs.channel }}
ORIGIN: ${{ needs.process.outputs.origin }}
VERSION: ${{ inputs.version }}
SERVICE: linux_${{ matrix.platform }}_verify
run: |
cd bundle/docker
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
docker compose down
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -203,6 +188,79 @@ jobs:
~/build/${{ matrix.exe }}* ~/build/${{ matrix.exe }}*
compression-level: 0 compression-level: 0
linux_armv7l:
needs: process
if: inputs.linux_armv7l
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Restore cached requirements
id: restore-cache
uses: actions/cache/restore@v4
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
with:
path: |
~/yt-dlp-build-venv
key: cache-reqs-${{ github.job }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm/v7
- name: Build executable
env:
EXE_NAME: yt-dlp_linux_armv7l
CHANNEL: ${{ inputs.channel }}
ORIGIN: ${{ needs.process.outputs.origin }}
VERSION: ${{ inputs.version }}
SERVICE: linux_armv7l
run: |
mkdir -p ~/build
mkdir -p ~/yt-dlp-build-venv
cd bundle/docker
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
docker compose down
sudo chown "${USER}:docker" ~/build/${EXE_NAME}
- name: Verify --update-to
if: vars.UPDATE_TO_VERIFICATION
env:
EXE_NAME: yt-dlp_linux_armv7l
CHANNEL: ${{ inputs.channel }}
ORIGIN: ${{ needs.process.outputs.origin }}
VERSION: ${{ inputs.version }}
SERVICE: linux_armv7l_verify
run: |
cd bundle/docker
docker compose up --build --exit-code-from "${SERVICE}" "${SERVICE}"
docker compose down
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-bin-${{ github.job }}
path: |
~/build/yt-dlp_linux_armv7l
compression-level: 0
- name: Cleanup cache
if: steps.restore-cache.outputs.cache-hit == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cache_key: cache-reqs-${{ github.job }}
run: |
gh cache delete "${cache_key}"
- name: Cache requirements
uses: actions/cache/save@v4
with:
path: |
~/yt-dlp-build-venv
key: cache-reqs-${{ github.job }}
musllinux: musllinux:
needs: process needs: process
if: inputs.musllinux if: inputs.musllinux
@ -459,6 +517,7 @@ jobs:
- process - process
- unix - unix
- linux - linux
- linux_armv7l
- musllinux - musllinux
- macos - macos
- windows - windows

View File

@ -48,6 +48,7 @@ services:
volumes: volumes:
- ~/build:/build - ~/build:/build
- ../..:/yt-dlp - ../..:/yt-dlp
- ~/yt-dlp-build-venv:/yt-dlp-build-venv
linux_armv7l_verify: linux_armv7l_verify:
build: build:

View File

@ -9,8 +9,8 @@ function runpy {
esac esac
} }
runpy -m venv ~/yt-dlp-build-venv runpy -m venv /yt-dlp-build-venv
source ~/yt-dlp-build-venv/bin/activate source /yt-dlp-build-venv/bin/activate
runpy -m devscripts.install_deps -o --include build runpy -m devscripts.install_deps -o --include build
runpy -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller runpy -m devscripts.install_deps --include secretstorage --include curl-cffi --include pyinstaller
runpy -m devscripts.make_lazy_extractors runpy -m devscripts.make_lazy_extractors

View File

@ -3,13 +3,12 @@ set -exuo
chmod +x /build/${EXE_NAME} chmod +x /build/${EXE_NAME}
# TEMPORARY:
/build/${EXE_NAME} -v --print-traffic -o- --impersonate chrome "https://tls.browserleaks.com/json" | cat
if [ -n "${SKIP_UPDATE_TO:-}" ]; then if [ -n "${SKIP_UPDATE_TO:-}" ]; then
/build/${EXE_NAME} -v || true /build/${EXE_NAME} -v || true
/build/${EXE_NAME} --version /build/${EXE_NAME} --version
# TEMPORARY:
/build/${EXE_NAME} -v --print-traffic -o- --impersonate chrome "https://tls.browserleaks.com/json" | cat
exit 0 exit 0
fi fi