X-Git-Url: https://jfr.im/git/yt-dlp.git/blobdiff_plain/733d8e8f9935534742408318274912704c5fae09..fd2ad7cb245423e49db1be9d9654c7dd3103619a:/.github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3082884aa..6820889e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,11 @@ name: Build - -on: - push: - branches: - - release +on: workflow_dispatch jobs: build_unix: runs-on: ubuntu-latest outputs: + version_suffix: ${{ steps.version_suffix.outputs.version_suffix }} ytdlp_version: ${{ steps.bump_version.outputs.ytdlp_version }} upload_url: ${{ steps.create_release.outputs.upload_url }} sha256_bin: ${{ steps.sha256_bin.outputs.sha256_bin }} @@ -26,23 +23,32 @@ jobs: python-version: '3.8' - name: Install packages run: sudo apt-get -y install zip pandoc man + - name: Set version suffix + id: version_suffix + env: + PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }} + if: "env.PUSH_VERSION_COMMIT == ''" + run: echo ::set-output name=version_suffix::$(date -u +"%H%M%S") - name: Bump version id: bump_version run: | - python devscripts/update-version.py + python devscripts/update-version.py ${{ steps.version_suffix.outputs.version_suffix }} make issuetemplates - - name: Print version - run: echo "${{ steps.bump_version.outputs.ytdlp_version }}" - - name: Update master - id: push_update + - name: Push to release + id: push_release run: | - git config --global user.email "${{ github.event.pusher.email }}" - git config --global user.name "${{ github.event.pusher.name }}" + git config --global user.name github-actions + git config --global user.email github-actions@example.com git add -u - git commit -m "[version] update" -m ":ci skip all" - git pull --rebase origin ${{ github.event.repository.master_branch }} - git push origin ${{ github.event.ref }}:${{ github.event.repository.master_branch }} + git commit -m "[version] update" -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all" + git push origin --force ${{ github.event.ref }}:release echo ::set-output name=head_sha::$(git rev-parse HEAD) + - name: Update master + id: push_master + env: + PUSH_VERSION_COMMIT: ${{ secrets.PUSH_VERSION_COMMIT }} + if: "env.PUSH_VERSION_COMMIT != ''" + run: git push origin ${{ github.event.ref }} - name: Get Changelog id: get_changelog run: | @@ -53,7 +59,7 @@ jobs: - name: Build lazy extractors id: lazy_extractors - run: python devscripts/make_lazy_extractors.py yt_dlp/extractor/lazy_extractors.py + run: python devscripts/make_lazy_extractors.py - name: Run Make run: make all tar - name: Get SHA2-256SUMS for yt-dlp @@ -90,7 +96,7 @@ jobs: env: BREW_TOKEN: ${{ secrets.BREW_TOKEN }} if: "env.BREW_TOKEN != ''" - uses: webfactory/ssh-agent@v0.5.3 + uses: yt-dlp/ssh-agent@v0.5.3 with: ssh-private-key: ${{ env.BREW_TOKEN }} - name: Update Homebrew Formulae @@ -113,11 +119,13 @@ jobs: with: tag_name: ${{ steps.bump_version.outputs.ytdlp_version }} release_name: yt-dlp ${{ steps.bump_version.outputs.ytdlp_version }} - commitish: ${{ steps.push_update.outputs.head_sha }} + commitish: ${{ steps.push_release.outputs.head_sha }} body: | - See [this](https://github.com/yt-dlp/yt-dlp#release-files) for a description of the files + #### [A description of the various files]((https://github.com/yt-dlp/yt-dlp#release-files)) are in the README + + --- - #### Changelog: + ### Changelog: ${{ env.changelog }} draft: false prerelease: false @@ -156,13 +164,13 @@ jobs: - name: Install Requirements run: | brew install coreutils - /usr/bin/python3 -m pip install -U --user pip Pyinstaller mutagen pycryptodomex websockets + /usr/bin/python3 -m pip install -U --user pip Pyinstaller==4.10 -r requirements.txt - name: Bump version id: bump_version run: /usr/bin/python3 devscripts/update-version.py - name: Build lazy extractors id: lazy_extractors - run: /usr/bin/python3 devscripts/make_lazy_extractors.py yt_dlp/extractor/lazy_extractors.py + run: /usr/bin/python3 devscripts/make_lazy_extractors.py - name: Run PyInstaller Script run: /usr/bin/python3 pyinst.py --target-architecture universal2 --onefile - name: Upload yt-dlp MacOS binary @@ -183,11 +191,9 @@ jobs: run: echo "::set-output name=sha512_macos::$(sha512sum dist/yt-dlp_macos | awk '{print $1}')" - name: Run PyInstaller Script with --onedir - run: /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir - - uses: papeloto/action-zip@v1 - with: - files: ./dist/yt-dlp_macos - dest: ./dist/yt-dlp_macos.zip + run: | + /usr/bin/python3 pyinst.py --target-architecture universal2 --onedir + zip ./dist/yt-dlp_macos.zip ./dist/yt-dlp_macos - name: Upload yt-dlp MacOS onedir id: upload-release-macos-zip uses: actions/upload-release-asset@v1 @@ -201,7 +207,7 @@ jobs: - name: Get SHA2-256SUMS for yt-dlp_macos.zip id: sha256_macos_zip run: echo "::set-output name=sha256_macos_zip::$(sha256sum dist/yt-dlp_macos.zip | awk '{print $1}')" - - name: Get SHA2-512SUMS for yt-dlp_macos + - name: Get SHA2-512SUMS for yt-dlp_macos.zip id: sha512_macos_zip run: echo "::set-output name=sha512_macos_zip::$(sha512sum dist/yt-dlp_macos.zip | awk '{print $1}')" @@ -227,13 +233,15 @@ jobs: # Custom pyinstaller built with https://github.com/yt-dlp/pyinstaller-builds run: | python -m pip install --upgrade pip setuptools wheel py2exe - pip install "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-4.5.1-py3-none-any.whl" mutagen pycryptodomex websockets + pip install "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt - name: Bump version id: bump_version - run: python devscripts/update-version.py + env: + version_suffix: ${{ needs.build_unix.outputs.version_suffix }} + run: python devscripts/update-version.py ${{ env.version_suffix }} - name: Build lazy extractors id: lazy_extractors - run: python devscripts/make_lazy_extractors.py yt_dlp/extractor/lazy_extractors.py + run: python devscripts/make_lazy_extractors.py - name: Run PyInstaller Script run: python pyinst.py - name: Upload yt-dlp.exe Windows binary @@ -254,11 +262,9 @@ jobs: run: echo "::set-output name=sha512_win::$((Get-FileHash dist\yt-dlp.exe -Algorithm SHA512).Hash.ToLower())" - name: Run PyInstaller Script with --onedir - run: python pyinst.py --onedir - - uses: papeloto/action-zip@v1 - with: - files: ./dist/yt-dlp - dest: ./dist/yt-dlp_win.zip + run: | + python pyinst.py --onedir + Compress-Archive -LiteralPath ./dist/yt-dlp -DestinationPath ./dist/yt-dlp_win.zip - name: Upload yt-dlp Windows onedir id: upload-release-windows-zip uses: actions/upload-release-asset@v1 @@ -314,13 +320,15 @@ jobs: - name: Install Requirements run: | python -m pip install --upgrade pip setuptools wheel - pip install "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-4.5.1-py3-none-any.whl" mutagen pycryptodomex websockets + pip install "https://yt-dlp.github.io/Pyinstaller-Builds/i686/pyinstaller-4.10-py3-none-any.whl" -r requirements.txt - name: Bump version id: bump_version - run: python devscripts/update-version.py + env: + version_suffix: ${{ needs.build_unix.outputs.version_suffix }} + run: python devscripts/update-version.py ${{ env.version_suffix }} - name: Build lazy extractors id: lazy_extractors - run: python devscripts/make_lazy_extractors.py yt_dlp/extractor/lazy_extractors.py + run: python devscripts/make_lazy_extractors.py - name: Run PyInstaller Script for 32 Bit run: python pyinst.py - name: Upload Executable yt-dlp_x86.exe