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 python -m pip install -U pip setuptools wheel twine
68 python -m pip install -U -r requirements.txt
72 python devscripts/update-version.py ${{ needs.prepare.outputs.version }}
73 python devscripts/make_lazy_extractors.py
75 - name: Build and publish on PyPI
77 TWINE_USERNAME: __token__
78 TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
79 if: env.TWINE_PASSWORD != ''
82 python devscripts/set-variant.py pip -M "You installed yt-dlp with pip or using the wheel from PyPi; Use that to update"
83 python setup.py sdist bdist_wheel
86 - name: Checkout Homebrew repository
88 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
89 PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
90 if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != ''
91 uses: actions/checkout@v3
93 repository: yt-dlp/homebrew-taps
95 ssh-key: ${{ secrets.BREW_TOKEN }}
97 - name: Update Homebrew Formulae
99 BREW_TOKEN: ${{ secrets.BREW_TOKEN }}
100 PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
101 if: env.BREW_TOKEN != '' && env.PYPI_TOKEN != ''
103 python devscripts/update-formulae.py taps/Formula/yt-dlp.rb "${{ needs.prepare.outputs.version }}"
104 git -C taps/ config user.name github-actions
105 git -C taps/ config user.email github-actions@example.com
106 git -C taps/ commit -am 'yt-dlp: ${{ needs.prepare.outputs.version }}'
111 uses: ./.github/workflows/build.yml
113 version: ${{ needs.prepare.outputs.version }}
116 packages: write # For package cache
118 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
121 needs: [prepare, build]
122 uses: ./.github/workflows/publish.yml
126 version: ${{ needs.prepare.outputs.version }}
127 target_commitish: ${{ needs.prepare.outputs.head_sha }}