10 runs-on: ubuntu-latest
12 version: ${{ steps.update_version.outputs.version }}
13 head_sha: ${{ steps.push_release.outputs.head_sha }}
16 - uses: actions/checkout@v3
20 - uses: actions/setup-python@v4
22 python-version: "3.10"
24 - name: Update version
27 python devscripts/update-version.py ${{ vars.PUSH_VERSION_COMMIT == '' && '"$(date -u +"%H%M%S")"' || '' }} | \
28 grep -Po "version=\d+\.\d+\.\d+(\.\d+)?" >> "$GITHUB_OUTPUT"
30 - name: Update documentation
33 sed '/### /Q' Changelog.md >> ./CHANGELOG
34 echo '### ${{ steps.update_version.outputs.version }}' >> ./CHANGELOG
35 python ./devscripts/make_changelog.py -vv -c >> ./CHANGELOG
37 grep -Poz '(?s)### \d+\.\d+\.\d+.+' 'Changelog.md' | head -n -1 >> ./CHANGELOG
38 cat ./CHANGELOG > Changelog.md
40 - name: Push to release
43 git config --global user.name github-actions
44 git config --global user.email github-actions@example.com
46 git commit -m "Release ${{ steps.update_version.outputs.version }}" \
47 -m "Created by: ${{ github.event.sender.login }}" -m ":ci skip all :ci run dl"
48 git push origin --force ${{ github.event.ref }}:release
49 echo "head_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
52 if: vars.PUSH_VERSION_COMMIT != ''
53 run: git push origin ${{ github.event.ref }}
55 publish_pypi_homebrew:
57 runs-on: ubuntu-latest
60 - uses: actions/checkout@v3
61 - uses: actions/setup-python@v4
63 python-version: "3.10"
65 - name: Install Requirements
67 sudo apt-get -y install pandoc man
68 python -m pip install -U pip setuptools wheel twine
69 python -m pip install -U -r requirements.txt
73 python devscripts/update-version.py ${{ needs.prepare.outputs.version }}
74 python devscripts/make_lazy_extractors.py
76 - name: Build and publish on PyPI
78 TWINE_USERNAME: __token__
79 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
80 if: env.TWINE_PASSWORD != ''
84 python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update"
85 python setup.py sdist bdist_wheel
88 - name: Checkout Homebrew repository
90 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
91 PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
92 if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != ''
93 uses: actions/checkout@v3
95 repository: yt-dlp/homebrew-taps
97 ssh-key: ${{ secrets.BREW_TOKEN }}
99 - name: Update Homebrew Formulae
101 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
102 PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
103 if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != ''
105 python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ needs.prepare.outputs.version }}"
106 git -C taps/ config user.name github-actions
107 git -C taps/ config user.email github-actions@example.com
108 git -C taps/ commit -am 'yt-dlp: ${{ needs.prepare.outputs.version }}'
113 uses: ./.github/workflows/build.yml
115 version: ${{ needs.prepare.outputs.version }}
118 packages: write # For package cache
120 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
123 needs: [prepare, build]
124 uses: ./.github/workflows/publish.yml
128 version: ${{ needs.prepare.outputs.version }}
129 target_commitish: ${{ needs.prepare.outputs.head_sha }}