28 runs-on: ubuntu-latest
31 - uses: actions/checkout@v3
34 - uses: actions/download-artifact@v3
35 - uses: actions/setup-python@v4
37 python-version: "3.10"
39 - name: Generate release notes
42 '[![Installation](https://img.shields.io/badge/-Which%20file%20should%20I%20download%3F-white.svg?style=for-the-badge)]' \
43 '(https://github.com/yt-dlp/yt-dlp#installation "Installation instructions") ' \
44 '[![Documentation](https://img.shields.io/badge/-Docs-brightgreen.svg?style=for-the-badge&logo=GitBook&labelColor=555555)]' \
45 '(https://github.com/yt-dlp/yt-dlp/tree/2023.03.04#readme "Documentation") ' \
46 '[![Donate](https://img.shields.io/badge/_-Donate-red.svg?logo=githubsponsors&labelColor=555555&style=for-the-badge)]' \
47 '(https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators "Donate") ' \
48 '[![Discord](https://img.shields.io/discord/807245652072857610?color=blue&labelColor=555555&label=&logo=discord&style=for-the-badge)]' \
49 '(https://discord.gg/H5MNcFW63r "Discord") ' \
50 ${{ inputs.channel != 'nightly' && '"[![Nightly](https://img.shields.io/badge/Get%20nightly%20builds-purple.svg?style=for-the-badge)]" \
51 "(https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest \"Nightly builds\")"' || '' }} \
53 printf '\n\n' >> ./RELEASE_NOTES
54 cat >> ./RELEASE_NOTES << EOF
55 #### A description of the various files are in the [README](https://github.com/yt-dlp/yt-dlp#release-files)
57 $(python ./devscripts/make_changelog.py -vv --collapsible)
59 printf '%s\n\n' '**This is an automated nightly pre-release build**' >> ./NIGHTLY_NOTES
60 cat ./RELEASE_NOTES >> ./NIGHTLY_NOTES
61 printf '%s\n\n' 'Generated from: https://github.com/${{ github.repository }}/commit/${{ inputs.target_commitish }}' >> ./ARCHIVE_NOTES
62 cat ./RELEASE_NOTES >> ./ARCHIVE_NOTES
64 - name: Archive nightly release
66 GH_TOKEN: ${{ secrets.ARCHIVE_REPO_TOKEN }}
67 GH_REPO: ${{ vars.ARCHIVE_REPO }}
69 inputs.channel == 'nightly' && env.GH_TOKEN != '' && env.GH_REPO != ''
72 --notes-file ARCHIVE_NOTES \
73 --title "yt-dlp nightly ${{ inputs.version }}" \
74 ${{ inputs.version }} \
77 - name: Prune old nightly release
78 if: inputs.channel == 'nightly' && !vars.ARCHIVE_REPO
80 GH_TOKEN: ${{ github.token }}
82 gh release delete --yes --cleanup-tag "nightly" || true
83 git tag --delete "nightly" || true
84 sleep 5 # Enough time to cover deletion race condition
86 - name: Publish release${{ inputs.channel == 'nightly' && ' (nightly)' || '' }}
88 GH_TOKEN: ${{ github.token }}
89 if: (inputs.channel == 'nightly' && !vars.ARCHIVE_REPO) || inputs.channel != 'nightly'
92 --notes-file ${{ inputs.channel == 'nightly' && 'NIGHTLY_NOTES' || 'RELEASE_NOTES' }} \
93 --target ${{ inputs.target_commitish }} \
94 --title "yt-dlp ${{ inputs.channel == 'nightly' && 'nightly ' || '' }}${{ inputs.version }}" \
95 ${{ inputs.prerelease && '--prerelease' || '' }} \
96 ${{ inputs.channel == 'nightly' && '"nightly"' || inputs.version }} \