Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

可以正常云编译和发布了 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
creazyboyone merged 25 commits into creazyboyone:master from loecom:master
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
465e5e5
Create build.yml
loecom Jun 7, 2025
dcbd714
Update build.yml
loecom Jun 7, 2025
4e30e44
Update build.yml
loecom Jun 8, 2025
767b2ad
这样修改后,JSON 反序列化就能正常工作,解决源生成模式下的兼容性问题。
loecom Jun 8, 2025
27d5367
Update FastGithub.csproj
loecom Jun 8, 2025
1ba9a53
Update FastGithub.csproj
loecom Jun 8, 2025
296833e
Update build.yml
loecom Jun 8, 2025
8b45b2e
Update build.yml
loecom Jun 8, 2025
e9e8831
Update build.yml
loecom Jun 8, 2025
55843f4
Update build.yml
loecom Jun 8, 2025
90ca53a
Update build.yml
loecom Jun 8, 2025
3bd45bf
Update build.yml
loecom Jun 8, 2025
9883612
Update build.yml
loecom Jun 8, 2025
4a569bc
Update build.yml
loecom Jun 8, 2025
9e52ea9
Update build.yml
loecom Jun 8, 2025
8436a32
Update build.yml
loecom Jun 8, 2025
20f1736
Update build.yml
loecom Jun 8, 2025
b88eaec
Update build.yml
loecom Jun 8, 2025
50cccc7
Update build.yml
loecom Jun 8, 2025
59aa7f0
Update GlobalListener.cs
loecom Jun 8, 2025
aa816bd
Update build.yml
loecom Jun 8, 2025
96399df
Update GlobalListener.cs
loecom Jun 8, 2025
f26fd60
Merge pull request #1 from loecom/可以正常编译正常使用。
loecom Jun 8, 2025
483e8cf
Create release.yml
loecom Jun 8, 2025
8767389
Update release.yml
loecom Jun 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/build.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build FastGithub

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'

- name: Restore dependencies
run: dotnet restore FastGithub.sln

- name: Build
run: dotnet build FastGithub.sln --no-restore --configuration Release

- name: Test
run: dotnet test FastGithub.sln --no-build --configuration Release --verbosity normal

build-multi-platform:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
runtime: linux-x64
artifact-name: fastgithub-linux-x64
- os: windows-latest
runtime: win-x64
artifact-name: fastgithub-win-x64
- os: macos-latest
runtime: osx-x64
artifact-name: fastgithub-osx-x64

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'

- name: Build for ${{ matrix.os }}
run: |
dotnet restore FastGithub.sln
dotnet build FastGithub.sln --configuration Release

- name: Publish single-file artifacts with UI
shell: bash
run: |
# 发布主程序
dotnet publish FastGithub/FastGithub.csproj \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-o ./publish/${{ matrix.runtime }}

# 发布 UI (仅 Windows)
if [ "${{ matrix.runtime }}" == "win-x64" ]; then
dotnet publish FastGithub.UI/FastGithub.UI.csproj \
-c Release \
-o ./publish/${{ matrix.runtime }}
fi

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ./publish/${{ matrix.runtime }}
185 changes: 185 additions & 0 deletions .github/workflows/release.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Create Release

on:
workflow_dispatch:
inputs:
version:
description: '版本号 (例如: v1.0.0)'
required: true
type: string
prerelease:
description: '是否为预发布版本'
required: false
type: boolean
default: false

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'

- name: Validate version format
run: |
if [[ ! "${{ github.event.inputs.version }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
echo "错误: 版本号格式不正确。请使用格式: v1.0.0 或 v1.0.0-beta"
exit 1
fi

- name: Check if tag exists
run: |
if git rev-parse "${{ github.event.inputs.version }}" >/dev/null 2>&1; then
echo "错误: 标签 ${{ github.event.inputs.version }} 已存在"
exit 1
fi

- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ github.event.inputs.version }}" -m "Release ${{ github.event.inputs.version }}"
git push origin "${{ github.event.inputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-artifacts:
needs: build-and-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
runtime: linux-x64
artifact-name: fastgithub-linux-x64
- os: windows-latest
runtime: win-x64
artifact-name: fastgithub-win-x64
- os: macos-latest
runtime: osx-x64
artifact-name: fastgithub-osx-x64

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'

- name: Restore dependencies
run: dotnet restore FastGithub.sln

- name: Build and publish
shell: bash
run: |
# 发布主程序
dotnet publish FastGithub/FastGithub.csproj \
-c Release \
-r ${{ matrix.runtime }} \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-o ./publish/${{ matrix.runtime }}

# 发布 UI (仅 Windows)
if [ "${{ matrix.runtime }}" == "win-x64" ]; then
dotnet publish FastGithub.UI/FastGithub.UI.csproj \
-c Release \
-o ./publish/${{ matrix.runtime }}
fi

- name: Create archive
shell: bash
run: |
cd ./publish/${{ matrix.runtime }}
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7z a -tzip ../../${{ matrix.artifact-name }}.zip *
else
tar -czf ../../${{ matrix.artifact-name }}.tar.gz *
fi

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
${{ matrix.artifact-name }}.zip
${{ matrix.artifact-name }}.tar.gz

create-github-release:
needs: build-artifacts
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version }}

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Prepare release assets
run: |
mkdir -p ./release-assets
find ./artifacts -name "*.zip" -o -name "*.tar.gz" | while read file; do
cp "$file" ./release-assets/
done
ls -la ./release-assets/

- name: Generate release notes
id: release_notes
run: |
cat > release_notes.md << 'EOF'
## FastGithub Release ${{ github.event.inputs.version }}

🚀 **新版本发布**

### 📦 下载说明
- **Windows 用户**: 下载 `fastgithub-win-x64.zip`
- **Linux 用户**: 下载 `fastgithub-linux-x64.tar.gz`
- **macOS 用户**: 下载 `fastgithub-osx-x64.tar.gz`

### 🔧 安装说明
请参考 [README.md](https://github.com/${{ github.repository }}/blob/main/README.md) 中的部署方式。

### ⚠️ 注意事项
- Windows版本包含UI界面程序
- 首次使用需要安装并信任CA证书
- 详细配置请查看项目文档

---

**完整更新日志**: https://github.com/${{ github.repository }}/compare/$(git describe --tags --abbrev=0 HEAD^)...${{ github.event.inputs.version }}
EOF

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
name: FastGithub ${{ github.event.inputs.version }}
body_path: release_notes.md
files: ./release-assets/*
draft: false
prerelease: ${{ github.event.inputs.prerelease }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup artifacts
run: rm -rf ./artifacts ./release-assets release_notes.md
8 changes: 4 additions & 4 deletions FastGithub.FlowAnalyze/FlowStatistics.cs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ public record FlowStatistics
/// <summary>
/// 获取总读上行
/// </summary>
public long TotalRead { get; init; }
public long TotalRead { get; set; }

/// <summary>
/// 获取总下行
/// </summary>
public long TotalWrite { get; init; }
public long TotalWrite { get; set; }

/// <summary>
/// 获取读取速率
/// </summary>
public double ReadRate { get; init; }
public double ReadRate { get; set; }

/// <summary>
/// 获取写入速率
/// </summary>
public double WriteRate { get; init; }
public double WriteRate { get; set; }
}
}
Loading

AltStyle によって変換されたページ (->オリジナル) /