generate-dictionaries #37
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
# 此 Github Action 自动运行 Python 脚本、生成词典并发布 release。 | |
name: generate-dictionaries | |
# 触发条件:每天 UTC 时间 0 时,即北京时间 8 时 | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
# 测试用触发条件 | |
#on: | |
# workflow_dispatch: | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
# 配置 Python 环境,安装 python 库,检出子模块 | |
- uses: actions/checkout@v4.0.0 | |
- name: setup-python | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: '3.11' | |
- name: install-pip-packages | |
uses: BSFishy/pip-action@v1 | |
with: | |
packages: | | |
requests | |
tqdm | |
- name: checkout-submodules | |
shell: bash | |
run: git submodule update --init --recursive | |
# 运行 Python 代码 | |
- name: run-python-codes | |
shell: bash | |
run: python3 ./main.py | |
# 获取日期并发布 GitHub Release | |
#- name: get-date | |
# id: date | |
# run: echo "date=$(date +'%Y-%m-%d')" | |
- name: create-release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
automatic_release_tag: latest | |
title: "每日构建" | |
files: | | |
output/* |