This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update ytdlp and release | |
on: | |
workflow_dispatch: | |
schedule: | |
# 每月1号 | |
- cron: '0 0 1 * *' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
update-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
# 克隆代码仓库 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# 设置Python环境 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Update yt-dlp | |
continue-on-error: true | |
run: | | |
pip install requests==2.32.3 | |
python update_ytdlp.py | |
pip install -r requirements.txt | |
- name: release-drafter | |
id: release-drafter | |
uses: release-drafter/release-drafter@v6 | |
with: | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# 构建并发布 | |
- name: Build and publish | |
continue-on-error: true | |
env: | |
TWINE_USERNAME: ${{secrets.PYPI_USERNAME}} | |
TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}} | |
YT_DLP_VERSION: ${{steps.release-drafter.outputs.tag_name}} | |
run: | | |
pip install wheel twine | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |