-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(main): add test_update switch option
- Loading branch information
1 parent
5c4ff2c
commit f186854
Showing
6 changed files
with
188 additions
and
152 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Auto Update & Commit | ||
description: "下载字体文件并执行脚本更新之后自动提交更改" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download Sarasa Gothic Mono Slab SC TTF Release Asset | ||
id: download_7z | ||
uses: robinraju/[email protected] | ||
with: | ||
# The source repository path. | ||
# Expected format {owner}/{repo} | ||
# Default: ${{ github.repository }} | ||
repository: "be5invis/Sarasa-Gothic" | ||
|
||
# A flag to set the download target as latest release | ||
# The default value is 'false' | ||
latest: true | ||
|
||
# The name of the file to download. | ||
# Use this field only to specify filenames other than tarball or zipball, if any. | ||
# Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..) | ||
fileName: "SarasaMonoSlabSC-TTF-Unhinted-*.7z" | ||
|
||
# Relative path under $GITHUB_WORKSPACE to place the downloaded file(s) | ||
# It will create the target directory automatically if not present | ||
# eg: out-file-path: "my-downloads" => It will create directory $GITHUB_WORKSPACE/my-downloads | ||
out-file-path: "tmp" | ||
|
||
- name: Extract downloaded 7z file Asset | ||
shell: bash | ||
# p7zip-full is already the newest version (ubuntu-latest). | ||
run: 7z x -t7z -otmp ${{ fromJson(steps.download_7z.outputs.downloaded_files)[0] }} | ||
|
||
- run: poetry run python main.py --all --auto_update --publish | ||
|
||
- name: Auto commit to repo. | ||
id: auto_commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
# Optional. Commit message for the created commit. | ||
# Defaults to "Apply automatic changes" | ||
commit_message: "docs(pages): AUTO update data[BOT]." | ||
|
||
# Optional. Options used by `git-commit`. | ||
# See https://git-scm.com/docs/git-commit#_options | ||
commit_options: "--no-verify --signoff" | ||
|
||
# Optional glob pattern of files which should be added to the commit | ||
# Defaults to all (.) | ||
# See the `pathspec`-documentation for git | ||
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203 | ||
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec | ||
file_pattern: "docs/" | ||
|
||
# Optional. Option used by `git-status` to determine if the repository is | ||
# dirty. See https://git-scm.com/docs/git-status#_options | ||
status_options: "--untracked-files=no" | ||
|
||
# Optional. Options used by `git-add`. | ||
# See https://git-scm.com/docs/git-add#_options | ||
add_options: "-u" | ||
|
||
# Optional. Skip internal call to `git fetch` | ||
skip_fetch: true | ||
|
||
# Optional. Skip internal call to `git checkout` | ||
skip_checkout: true | ||
|
||
# Optional. Prevents the shell from expanding filenames. | ||
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html | ||
disable_globbing: true | ||
|
||
- if: steps.auto_commit.outputs.changes_detected == 'true' | ||
run: echo "Update Done!" |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Update Game Data | ||
|
||
on: | ||
schedule: | ||
# UTC time for 10:30 & 16:30 (UTC+8) | ||
- cron: "30 2,8 * * *" | ||
workflow_dispatch: | ||
|
||
# Global permissions configuration starts here | ||
permissions: | ||
# 'write' access to repository contents | ||
contents: write | ||
|
||
concurrency: | ||
group: "update" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cehckout root repo firstly. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout ArknightsGameData Repo. | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "Kengxxiao/ArknightsGameData" | ||
path: "Github/ArknightsGameData" | ||
filter: "blob:none" | ||
sparse-checkout: "zh_CN/gamedata/" | ||
|
||
- name: Checkout ArknightsGameResource Repo. | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "yuanyan3060/ArknightsGameResource" | ||
path: "Github/ArknightsGameResource" | ||
filter: "blob:none" | ||
sparse-checkout: "gamedata/" | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: "poetry" | ||
- name: Install Poetry Dependences. | ||
run: poetry install | ||
|
||
- name: Test if need update | ||
id: test_update | ||
run: poetry run python main.py --all --auto_update --test_update --no_dump | ||
|
||
- if: steps.test_update.outputs.test_update == 'True' | ||
name: Auto update data | ||
uses: ./.github/actions/auto-update |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
package-mode = false | ||
name = "arknights-word-count" | ||
version = "3.7.1" | ||
version = "3.8.0" | ||
description = "《明日方舟》字词统计" | ||
authors = ["Shawn Sun <[email protected]>"] | ||
license = "MIT" | ||
|