9 Commits

Author SHA1 Message Date
2ba1bfa6e5 修改目录 2025-11-17 17:22:43 +08:00
e7f363ffad 更新库 2025-11-12 14:49:41 +08:00
0b6403c8d7 更新库 2025-11-11 14:52:29 +08:00
d3e5787508 不是用加速地址,容易失效 2025-11-10 19:03:39 +08:00
413df78f51 使用加速地址更新 2025-11-10 18:53:48 +08:00
07c5527243 更新库版本 2025-11-10 17:48:29 +08:00
乔焰阳
680d36e526 Simplify artifact handling in release workflow
Removed Gitea-specific artifact upload and download steps, simplifying the workflow.
2025-11-06 17:50:20 +08:00
乔焰阳
0a5432406a Refactor GitHub Actions workflow for releases
Updated GitHub Actions workflow to remove caching for Go installation and GF CLI, and adjusted artifact upload and download steps for GitHub and Gitea.
2025-11-06 17:20:34 +08:00
乔焰阳
7b16777411 Enhance release workflow with caching steps
Added caching for Go installation and GF CLI in the release workflow.
2025-11-06 16:03:04 +08:00
4 changed files with 13 additions and 12 deletions

View File

@@ -23,13 +23,15 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 # 使用最新稳定的v4版本 uses: actions/checkout@v4 # 使用最新稳定的v4版本
# GitHub Actions的runner环境通常已预装GoSetup Go步骤会处理版本管理
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 'stable' # 使用最新稳定版本的Go无需手动更新版本号 go-version: 'stable' # 使用最新稳定版本的Go无需手动更新版本号
- name: Install gf CLI - name: Install gf CLI
run: | run: |
# 直接下载GF CLI不使用缓存以避免超时问题
echo "Downloading GF CLI"
curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64 curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64
chmod +x gf chmod +x gf
mkdir -p "$HOME/bin" mkdir -p "$HOME/bin"
@@ -43,8 +45,7 @@ jobs:
run: gf build -ew -v "${{ github.ref_name }}" run: gf build -ew -v "${{ github.ref_name }}"
- name: Upload build artifacts - name: Upload build artifacts
# 使用main分支以获取最新版本的action无需手动更新版本 uses: actions/upload-artifact@v4 # 使用v4版本
uses: actions/upload-artifact@main
with: with:
name: p2p-${{ github.ref_name }} name: p2p-${{ github.ref_name }}
path: | path: |
@@ -62,8 +63,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download artifacts - name: Download artifacts
# 使用main分支以获取最新版本的action无需手动更新版本 uses: actions/download-artifact@v4 # 使用v4版本
uses: actions/download-artifact@main
with: with:
name: p2p-${{ github.ref_name }} name: p2p-${{ github.ref_name }}
path: bin path: bin

4
go.mod
View File

@@ -5,10 +5,10 @@ go 1.24.8
toolchain go1.24.9 toolchain go1.24.9
require ( require (
github.com/ayflying/update-github-release v0.0.4 github.com/ayflying/update-github-release v0.0.8
github.com/dop251/goja v0.0.0-20250630131328-58d95d85e994 github.com/dop251/goja v0.0.0-20250630131328-58d95d85e994
github.com/getlantern/systray v1.2.2 github.com/getlantern/systray v1.2.2
github.com/gogf/gf/v2 v2.9.4 github.com/gogf/gf/v2 v2.9.5
github.com/gorilla/websocket v1.5.3 github.com/gorilla/websocket v1.5.3
github.com/libp2p/go-libp2p v0.43.0 github.com/libp2p/go-libp2p v0.43.0
github.com/libp2p/go-libp2p-kad-dht v0.35.1 github.com/libp2p/go-libp2p-kad-dht v0.35.1

8
go.sum
View File

@@ -13,8 +13,8 @@ github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/ayflying/update-github-release v0.0.4 h1:iJ09jieBFW/t96N3NqcFA6tS7hxKx4fnETp5VC7jSbo= github.com/ayflying/update-github-release v0.0.8 h1:/ieMrqSi8novY9uSALPVSlWcBFdknDDhtgt08GKMojg=
github.com/ayflying/update-github-release v0.0.4/go.mod h1:9ctXuagiEKABWLaS4ocRCUcnN77jdYm7zir7NQ+rIeM= github.com/ayflying/update-github-release v0.0.8/go.mod h1:9ctXuagiEKABWLaS4ocRCUcnN77jdYm7zir7NQ+rIeM=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -92,8 +92,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/gogf/gf/v2 v2.9.4 h1:6vleEWypot9WBPncP2GjbpgAUeG6Mzb1YESb9nPMkjY= github.com/gogf/gf/v2 v2.9.5 h1:1scfOdHbMP854oQaiLejl+eL+c4xfuvtWmmZiDJxbKs=
github.com/gogf/gf/v2 v2.9.4/go.mod h1:Ukl+5HUH9S7puBmNLR4L1zUqeRwi0nrW4OigOknEztU= github.com/gogf/gf/v2 v2.9.5/go.mod h1:VUb5eyJKpvW77O/dXsbbLNO/Kjrg0UycIiq0lRiBjjo=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=

View File

@@ -13,7 +13,8 @@ func Boot() {
getDev, _ := g.Cfg().GetWithEnv(gctx.New(), "dev") getDev, _ := g.Cfg().GetWithEnv(gctx.New(), "dev")
if !getDev.Bool() { if !getDev.Bool() {
var update = updateGithub.New("https://api.github.com/repos/ayflying/p2p/releases/latest") url := "https://api.github.com/repos/ayflying/p2p/releases/latest"
var update = updateGithub.New(url)
// 每天0点检查更新 // 每天0点检查更新
gcron.Add(gctx.New(), "0 0 0 * * *", func(ctx context.Context) { gcron.Add(gctx.New(), "0 0 0 * * *", func(ctx context.Context) {
err := update.CheckUpdate(true) err := update.CheckUpdate(true)