-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.31 KB
/
generate.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 此 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/*