on:
workflow_call:
inputs:
- nightly:
- default: false
- required: false
- type: boolean
+ channel:
+ default: stable
+ required: true
+ type: string
version:
required: true
type: string
target_commitish:
required: true
type: string
+ prerelease:
+ default: false
+ required: true
+ type: boolean
secrets:
ARCHIVE_REPO_TOKEN:
required: false
- name: Generate release notes
run: |
+ printf '%s' \
+ '[![Installation](https://img.shields.io/badge/-Which%20file%20should%20I%20download%3F-white.svg?style=for-the-badge)]' \
+ '(https://github.com/yt-dlp/yt-dlp#installation "Installation instructions") ' \
+ '[![Documentation](https://img.shields.io/badge/-Docs-brightgreen.svg?style=for-the-badge&logo=GitBook&labelColor=555555)]' \
+ '(https://github.com/yt-dlp/yt-dlp/tree/2023.03.04#readme "Documentation") ' \
+ '[![Donate](https://img.shields.io/badge/_-Donate-red.svg?logo=githubsponsors&labelColor=555555&style=for-the-badge)]' \
+ '(https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators "Donate") ' \
+ '[![Discord](https://img.shields.io/discord/807245652072857610?color=blue&labelColor=555555&label=&logo=discord&style=for-the-badge)]' \
+ '(https://discord.gg/H5MNcFW63r "Discord") ' \
+ ${{ inputs.channel != 'nightly' && '"[![Nightly](https://img.shields.io/badge/Get%20nightly%20builds-purple.svg?style=for-the-badge)]" \
+ "(https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/latest \"Nightly builds\")"' || '' }} \
+ > ./RELEASE_NOTES
+ printf '\n\n' >> ./RELEASE_NOTES
cat >> ./RELEASE_NOTES << EOF
#### A description of the various files are in the [README](https://github.com/yt-dlp/yt-dlp#release-files)
---
$(python ./devscripts/make_changelog.py -vv)
</details>
EOF
- echo "**This is an automated nightly pre-release build**" >> ./PRERELEASE_NOTES
- cat ./RELEASE_NOTES >> ./PRERELEASE_NOTES
- echo "Generated from: https://github.com/${{ github.repository }}/commit/${{ inputs.target_commitish }}" >> ./ARCHIVE_NOTES
+ printf '%s\n\n' '**This is an automated nightly pre-release build**' >> ./NIGHTLY_NOTES
+ cat ./RELEASE_NOTES >> ./NIGHTLY_NOTES
+ printf '%s\n\n' 'Generated from: https://github.com/${{ github.repository }}/commit/${{ inputs.target_commitish }}' >> ./ARCHIVE_NOTES
cat ./RELEASE_NOTES >> ./ARCHIVE_NOTES
- name: Archive nightly release
GH_TOKEN: ${{ secrets.ARCHIVE_REPO_TOKEN }}
GH_REPO: ${{ vars.ARCHIVE_REPO }}
if: |
- inputs.nightly && env.GH_TOKEN != '' && env.GH_REPO != ''
+ inputs.channel == 'nightly' && env.GH_TOKEN != '' && env.GH_REPO != ''
run: |
gh release create \
--notes-file ARCHIVE_NOTES \
artifact/*
- name: Prune old nightly release
- if: inputs.nightly && !vars.ARCHIVE_REPO
+ if: inputs.channel == 'nightly' && !vars.ARCHIVE_REPO
env:
GH_TOKEN: ${{ github.token }}
run: |
git tag --delete "nightly" || true
sleep 5 # Enough time to cover deletion race condition
- - name: Publish release${{ inputs.nightly && ' (nightly)' || '' }}
+ - name: Publish release${{ inputs.channel == 'nightly' && ' (nightly)' || '' }}
env:
GH_TOKEN: ${{ github.token }}
- if: (inputs.nightly && !vars.ARCHIVE_REPO) || !inputs.nightly
+ if: (inputs.channel == 'nightly' && !vars.ARCHIVE_REPO) || inputs.channel != 'nightly'
run: |
gh release create \
- --notes-file ${{ inputs.nightly && 'PRE' || '' }}RELEASE_NOTES \
+ --notes-file ${{ inputs.channel == 'nightly' && 'NIGHTLY_NOTES' || 'RELEASE_NOTES' }} \
--target ${{ inputs.target_commitish }} \
- --title "yt-dlp ${{ inputs.nightly && 'nightly ' || '' }}${{ inputs.version }}" \
- ${{ inputs.nightly && '--prerelease "nightly"' || inputs.version }} \
+ --title "yt-dlp ${{ inputs.channel == 'nightly' && 'nightly ' || '' }}${{ inputs.version }}" \
+ ${{ inputs.prerelease && '--prerelease' || '' }} \
+ ${{ inputs.channel == 'nightly' && '"nightly"' || inputs.version }} \
artifact/*