From 582510fdcb5b52c696748b872737b1303fa42c2e Mon Sep 17 00:00:00 2001 From: Simon Sawicki Date: Sun, 28 Apr 2024 20:16:51 +0200 Subject: [PATCH] Cleanup --- .github/workflows/build.yml | 78 ++++++++++++++---------------- bundle/docker/static/entrypoint.sh | 6 +-- 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6cacd7dc..d95ef7efd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,14 +51,14 @@ on: required: true default: stable type: string - linux_static: - description: yt-dlp_linux - default: true - type: boolean unix: description: yt-dlp, yt-dlp.tar.gz default: true type: boolean + linux_static: + description: yt-dlp_linux + default: true + type: boolean linux_arm: description: yt-dlp_linux_aarch64, yt-dlp_linux_armv7l default: true @@ -79,10 +79,6 @@ on: description: yt-dlp_x86.exe default: true type: boolean - meta_files: - description: SHA2-256SUMS, SHA2-512SUMS, _update_spec - default: true - type: boolean origin: description: Origin required: false @@ -105,39 +101,6 @@ jobs: run: | echo "origin=${{ inputs.origin == 'current repo' && github.repository || inputs.origin }}" | tee "$GITHUB_OUTPUT" - linux_static: - needs: process - if: inputs.linux_static - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build static executable - env: - channel: ${{ inputs.channel }} - origin: ${{ needs.process.outputs.origin }} - version: ${{ inputs.version }} - run: | - mkdir /build - cd bundle/docker - docker compose up --build static - - name: Verify --update-to - if: vars.UPDATE_TO_VERIFICATION - run: | - for binary in /build/*; do - chmod +x "${binary}" - cp "${binary}" "${binary}_downgraded" - version="$("${binary}" --version)" - "${binary}_downgraded" -v --update-to yt-dlp/yt-dlp@2023.03.04 - downgraded_version="$("${binary}_downgraded" --version)" - [[ "$version" != "$downgraded_version" ]] - done - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: build-bin-${{ github.job }} - path: /build/* - compression-level: 0 - unix: needs: process if: inputs.unix @@ -178,6 +141,39 @@ jobs: yt-dlp.tar.gz compression-level: 0 + linux_static: + needs: process + if: inputs.linux_static + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build static executable + env: + channel: ${{ inputs.channel }} + origin: ${{ needs.process.outputs.origin }} + version: ${{ inputs.version }} + run: | + mkdir /build + cd bundle/docker + docker compose up --build static + - name: Verify --update-to + if: vars.UPDATE_TO_VERIFICATION + run: | + for binary in /build/*; do + chmod +x "${binary}" + cp "${binary}" "${binary}_downgraded" + version="$("${binary}" --version)" + "${binary}_downgraded" -v --update-to yt-dlp/yt-dlp@2023.03.04 + downgraded_version="$("${binary}_downgraded" --version)" + [[ "$version" != "$downgraded_version" ]] + done + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: build-bin-${{ github.job }} + path: /build/* + compression-level: 0 + linux_arm: needs: process if: inputs.linux_arm diff --git a/bundle/docker/static/entrypoint.sh b/bundle/docker/static/entrypoint.sh index a4296f679..7abd0641c 100755 --- a/bundle/docker/static/entrypoint.sh +++ b/bundle/docker/static/entrypoint.sh @@ -5,10 +5,10 @@ source ~/.local/share/pipx/venvs/pyinstaller/bin/activate python -m devscripts.install_deps --include secretstorage python -m devscripts.make_lazy_extractors python devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" -python -m bundle.pyinstaller --name yt-dlp_static +python -m bundle.pyinstaller --name yt-dlp_linux deactivate source ~/.local/share/pipx/venvs/staticx/bin/activate -staticx /yt-dlp/dist/yt-dlp_static /build/yt-dlp_static +staticx /yt-dlp/dist/yt-dlp_linux /build/yt-dlp_linux deactivate -chmod +rx /build/yt-dlp_static +chmod +rx /build/yt-dlp_linux