Skip to content

Commit

Permalink
更新 文件名
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Oct 16, 2024
1 parent f0a389f commit 4d3deaf
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 确保检出完整的Git历史
fetch-depth: 0 # Ensures full Git history is checked out

- name: Set up Python 3.11
uses: actions/setup-python@v5
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Build executables (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
for script in BestDnsUpdater.py BestHostsUpdater-IPv4.py BestHostsUpdater.py; do
for script in SetDNS.py SetHosts-IPv4.py SetHosts.py; do
pyinstaller --onefile "$script"
mv "dist/${script%.py}" "dist/${script%.py}-Linux-x64"
done
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Build executables (Windows)
if: matrix.os == 'windows-latest'
run: |
$scripts = @("BestDnsUpdater.py", "BestHostsUpdater-IPv4.py", "BestHostsUpdater.py")
$scripts = @("SetDNS.py", "SetHosts-IPv4.py", "SetHosts.py")
if (Test-Path -Path "dist") {
Remove-Item -Recurse -Force "dist"
}
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Build executables (macOS)
if: matrix.os == 'macos-latest'
run: |
for script in BestDnsUpdater.py BestHostsUpdater-IPv4.py BestHostsUpdater.py; do
for script in SetDNS.py SetHosts-IPv4.py SetHosts.py; do
pyinstaller --onefile "$script"
mv "dist/${script%.py}" "dist/${script%.py}-macOS-x64"
done
Expand All @@ -86,7 +86,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 确保检出完整的Git历史
fetch-depth: 0 # Ensures full Git history is checked out

- name: Download all artifacts
uses: actions/download-artifact@v3
Expand All @@ -95,13 +95,15 @@ jobs:
id: tag_description
run: |
TAG_DESCRIPTION=$(git tag -l --format='%(contents)' ${{ github.ref_name }})
echo "tag_description=${TAG_DESCRIPTION}" >> $GITHUB_ENV
echo "tag_description=${TAG_DESCRIPTION}" >> $GITHUB_OUTPUT
shell: bash

- name: Get latest commit message
id: commit_message
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_ENV
echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT
shell: bash

- name: Delete existing release
uses: dev-drprasad/[email protected]
Expand All @@ -110,24 +112,23 @@ jobs:
delete_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: List Files
run: ls -R ./
shell: bash

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: "${{ github.ref_name }} ${{ env.tag_description }}"
draft: false
prerelease: false
run: |
gh release create ${{ github.ref_name }} \
--title "${{ github.ref_name }} ${{ steps.tag_description.outputs.tag_description }}" \
--notes "Release for ${{ github.ref_name }}
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
**/cnNetTool-Linux-x64.zip
**/cnNetTool-Windows-x64.zip
**/cnNetTool-macOS-x64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Changes in this release:
${{ steps.commit_message.outputs.commit_message }}" \
--draft=false \
./cnNetTool-Linux-x64.zip \
./cnNetTool-Windows-x64.zip \
./cnNetTool-macOS-x64.zip
shell: bash
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ pip install -r requirements.txt

**CloudflareBestIP** 可以接受以下参数:

### DNS 服务器工具 `BestDnsUpdater.py`
### DNS 服务器工具 `SetDNS.py`

* --debug 启用调试日志
* --show-availbale-list, --list 显示可用dns列表,通过 --num 控制娴熟数量
* --best-dns-num BEST_DNS_NUM, --num 显示最佳DNS服务器的数量
* --algorithm --mode {region,overall} 默认 `region` 平衡IPv4和ipv6 DNS
* --show-resolutions, --show 显示域名解析结果

### Hosts文件工具 `BestHostsUpdater.py`
### Hosts文件工具 `SetHosts.py`

* --log-level 设置日志输出等级,'DEBUG', 'INFO', 'WARNING', 'ERROR'
* --num-fastest 设置选择的最快IP数量
* --max-latency 设置允许的最大延迟(毫秒)

命令行键入 `-h` `help` 获取帮助

`py BestDnsUpdater.py -h`
`py SetDNS.py -h`

`py BestHostsUpdater.py -h`
`py SetHosts.py -h`

# 运行

请使用管理员权限,在项目目录运行,分别设置解析最快的DNS服务器,更新hosts文件。 **接受传递参数,大部分时候直接运行即可**

```bash
py BestDnsUpdater.py
py BestHostsUpdater.py
py SetDNS.py
py SetHosts.py
```

# 最新发行版下载
Expand All @@ -60,8 +60,8 @@ Windows下载可执行文件双击运行即可,注意使用管理员权限。l
或在命令行设置参数运行:

```pwsh
./BestDnsUpdater.exe --best-dns-num 10
./BestHostsUpdater.exe --num-fastest 3 --max-latency 500
./SetDNS.exe --best-dns-num 10
./SetHosts.exe --num-fastest 3 --max-latency 500
```

[![Release Detail](https://img.shields.io/github/v/release/sinspired/cnNetTool?sort=date&display_name=release&logo=github&label=Release)](https://github.com/sinspired/cnNetTool/releases/latest)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4d3deaf

Please sign in to comment.