-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.0.0a2' into main
- Loading branch information
Showing
73 changed files
with
3,494 additions
and
2,156 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,71 @@ | ||
version: "2" # required to adjust maintainability checks | ||
|
||
checks: | ||
argument-count: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
complex-logic: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
file-lines: | ||
enabled: true | ||
config: | ||
threshold: 250 | ||
method-complexity: | ||
enabled: true | ||
config: | ||
threshold: 5 | ||
method-count: | ||
enabled: true | ||
config: | ||
threshold: 20 | ||
method-lines: | ||
enabled: true | ||
config: | ||
threshold: 25 | ||
nested-control-flow: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
return-statements: | ||
enabled: true | ||
config: | ||
threshold: 4 | ||
similar-code: | ||
enabled: true | ||
config: | ||
threshold: #language-specific defaults. overrides affect all languages. | ||
identical-code: | ||
enabled: true | ||
config: | ||
threshold: #language-specific defaults. overrides affect all languages. | ||
|
||
plugins: | ||
bandit: | ||
enabled: true | ||
checks: | ||
assert_used: | ||
enabled: false | ||
blacklist: | ||
enabled: false | ||
subprocess_without_shell_equals_true: | ||
enabled: false | ||
pep8: | ||
enabled: true | ||
checks: | ||
E501: | ||
enabled: false | ||
sonar-python: | ||
enabled: true | ||
checks: | ||
python:S1871: | ||
enabled: false | ||
python:S125: | ||
enabled: false | ||
|
||
exclude_patterns: | ||
- "arknights_mower/data/*.py" | ||
- "**/*.png" | ||
- "arknights_mower/ocr/*.py" |
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,27 @@ | ||
# git hooks | ||
|
||
## Install | ||
|
||
```bash | ||
git config core.hooksPath `git rev-parse --show-toplevel`/.github/git-hooks | ||
``` | ||
|
||
## git commit 提交规范 | ||
|
||
参考:https://www.conventionalcommits.org/zh-hans/v1.0.0-beta.4/ | ||
|
||
- build: Changes that affect the build system or external dependencies. | ||
- chore: Others. | ||
- ci: Changes to our CI configuration files and scripts. | ||
- docs: Documentation only changes. | ||
- feat: A new feature. | ||
- fix: A bug fix. | ||
- hotfix: Publish a hotfix. | ||
- perf: A code change that improves performance. | ||
- refactor: A code change that neither fixes a bug or adds a feature. | ||
- release: Publish a new release. | ||
- revert: Revert the last commit. | ||
- style: Changes that do not affect the meaning of the code. | ||
- test: Adding missing tests or correcting existing tests. | ||
- update: Data updates. | ||
- workflow: Changes to our workflow configuration files and scripts. |
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,18 @@ | ||
#!/bin/bash | ||
|
||
# https://www.conventionalcommits.org/zh-hans/v1.0.0-beta.4/ | ||
|
||
COMMIT_MESSAGE=`cat $1` | ||
COMMIT_RE="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|release|hotfix|workflow|update)(\(.+\))?: .{1,100}" | ||
MERGE_RE="^Merge " | ||
|
||
if [[ ! $COMMIT_MESSAGE =~ $COMMIT_RE ]] && [[ ! $COMMIT_MESSAGE =~ $MERGE_RE ]] | ||
then | ||
echo "Illegal commit message format:" | ||
echo $COMMIT_MESSAGE | ||
echo "" | ||
echo "Please use the correct format." | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
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,18 @@ | ||
# git-flow hooks | ||
|
||
## Install | ||
|
||
```bash | ||
git config gitflow.path.hooks `git rev-parse --show-toplevel`/.github/gitflow-hooks | ||
``` | ||
|
||
## git-flow config | ||
|
||
- Branch name for production releases: `main` | ||
- Branch name for "next release" development: `dev` | ||
- Feature branch prefix: `feature/` | ||
- Bugfix branch prefix: `bugfix/` | ||
- Release branch prefix: `release/` | ||
- Hotfix branch prefix: `hotfix/` | ||
- Support branch prefix: `support/` | ||
- Version tag prefix: `v` |
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,28 @@ | ||
#!/bin/bash | ||
# | ||
# Runs during git flow hotfix start | ||
# | ||
# Positional arguments: | ||
# $1 Version | ||
# | ||
# Return VERSION - When VERSION is returned empty, git-flow will stop as the | ||
# version is necessary | ||
# | ||
# The following variables are available as they are exported by git-flow: | ||
# | ||
# MASTER_BRANCH - The branch defined as Master | ||
# DEVELOP_BRANCH - The branch defined as Develop | ||
# | ||
# VERSION=$1 | ||
|
||
VERSION=$1 | ||
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(a[1-9][0-9]*)?$" | ||
if [[ ! $VERSION =~ $VERSION_RE ]] | ||
then | ||
# echo "Illegal version format: $VERSION" | ||
exit 1 | ||
fi | ||
|
||
# Return the VERSION | ||
echo $VERSION | ||
exit 0 |
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,28 @@ | ||
#!/bin/bash | ||
# | ||
# Runs during git flow release start | ||
# | ||
# Positional arguments: | ||
# $1 Version | ||
# | ||
# Return VERSION - When VERSION is returned empty, git-flow will stop as the | ||
# version is necessary | ||
# | ||
# The following variables are available as they are exported by git-flow: | ||
# | ||
# MASTER_BRANCH - The branch defined as Master | ||
# DEVELOP_BRANCH - The branch defined as Develop | ||
# | ||
# VERSION=$1 | ||
|
||
VERSION=$1 | ||
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(a[1-9][0-9]*)?$" | ||
if [[ ! $VERSION =~ $VERSION_RE ]] | ||
then | ||
# echo "Illegal version format: $VERSION" | ||
exit 1 | ||
fi | ||
|
||
# Return the VERSION | ||
echo $VERSION | ||
exit 0 |
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,26 @@ | ||
#!/bin/bash | ||
# | ||
# Runs at the end of git flow hotfix start | ||
# | ||
# Positional arguments: | ||
# $1 The version (including the version prefix) | ||
# $2 The origin remote | ||
# $3 The full branch name (including the hotfix prefix) | ||
# $4 The base from which this hotfix is started | ||
# | ||
# The following variables are available as they are exported by git-flow: | ||
# | ||
# MASTER_BRANCH - The branch defined as Master | ||
# DEVELOP_BRANCH - The branch defined as Develop | ||
# | ||
# VERSION=$1 | ||
# ORIGIN=$2 | ||
# BRANCH=$3 | ||
# BASE=$4 | ||
|
||
ROOT=`git rev-parse --show-toplevel` | ||
VERSION=${1:1} | ||
|
||
sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py" | ||
git add "$ROOT/arknights_mower/__init__.py" | ||
git commit -m "hotfix: v$VERSION" |
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,26 @@ | ||
#!/bin/bash | ||
# | ||
# Runs at the end of git flow release start | ||
# | ||
# Positional arguments: | ||
# $1 The version (including the version prefix) | ||
# $2 The origin remote | ||
# $3 The full branch name (including the release prefix) | ||
# $4 The base from which this release is started | ||
# | ||
# The following variables are available as they are exported by git-flow: | ||
# | ||
# MASTER_BRANCH - The branch defined as Master | ||
# DEVELOP_BRANCH - The branch defined as Develop | ||
# | ||
# VERSION=$1 | ||
# ORIGIN=$2 | ||
# BRANCH=$3 | ||
# BASE=$4 | ||
|
||
ROOT=`git rev-parse --show-toplevel` | ||
VERSION=${1:1} | ||
|
||
sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py" | ||
git add "$ROOT/arknights_mower/__init__.py" | ||
git commit -m "release: v$VERSION" |
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,48 @@ | ||
name: Windows Binary Package (Alpha) | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' | ||
|
||
jobs: | ||
build-win-amd64: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get the version | ||
id: get_version | ||
shell: bash | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} | ||
- name: Set up Python 3.9 amd64 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
architecture: x64 | ||
- name: Install dependencies | ||
shell: cmd | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m venv venv64 | ||
venv64\Scripts\python -m pip install --upgrade pip wheel setuptools | ||
venv64\Scripts\python -m pip install -r requirements.txt | ||
venv64\Scripts\python -m pip install pyinstaller | ||
- name: Make package | ||
shell: cmd | ||
run: | | ||
venv64\Scripts\pyinstaller .\main.spec --onefile | ||
md public | ||
move dist\main.exe public\arknights_mower.exe | ||
- name: Package into zip | ||
uses: vimtor/action-zip@v1 | ||
with: | ||
files: public/ | ||
recursive: false | ||
dest: arknights-mower_cp39_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
prerelease: true | ||
body_path: doc/CHANGELOG.md | ||
files: arknights-mower_cp39_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip |
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
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,4 +1,4 @@ | ||
graft arknights_mower/resources | ||
graft arknights_mower/models | ||
graft arknights_mower/fonts | ||
graft arknights_mower/template | ||
graft arknights_mower/templates |
Oops, something went wrong.