Update Bin #9
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 Bin | |
on: | |
schedule: | |
# 每天UTC时间00:00运行 | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' | |
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 }} | |
# 获取并安装 um.exe | |
# - name: Update um.exe | |
# run: | | |
# um_version="最新的版本号逻辑" | |
# wget -O um-windows-amd64.tar.gz "f'{um_version}/um-windows-amd64.tar.gz'" | |
# tar -zxvf um-windows-amd64.tar.gz -C /path/to/extract/ | |
# 构建并发布 | |
- 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: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* |