mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-10 10:30:28 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c6c361d30 | ||
|
|
872ba0ba87 | ||
|
|
93c14dcee5 | ||
|
|
1af0b2175c | ||
|
|
ee81ebffef | ||
|
|
dc00fd2543 | ||
|
|
11015c7be1 | ||
|
|
57befd2c03 | ||
|
|
35156ed968 | ||
|
|
ee6c36174f | ||
|
|
fdfd95555d | ||
|
|
7ec824edda | ||
|
|
1f8b1be669 | ||
|
|
b0bcfeae34 | ||
|
|
10b346a326 | ||
|
|
a85af39b35 |
No files matched your search
+25
-26
@@ -8,18 +8,16 @@ jobs:
|
||||
get-release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag_name: ${{ steps.get_release.outputs.tag_name }}
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
tag_name: ${{ steps.get-release.outputs.tag_name }}
|
||||
upload_url: ${{ steps.get-release.outputs.upload_url }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: thebritican/fetch-latest-release@v2
|
||||
id: get_release
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
- uses: thebritican/fetch-latest-release@v2.0.0
|
||||
id: get-release
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -29,7 +27,7 @@ jobs:
|
||||
- uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop
|
||||
cd ui/flutter
|
||||
@@ -44,7 +42,8 @@ jobs:
|
||||
cp $system\vcruntime140.dll $release
|
||||
cp $system\vcruntime140_1.dll $release
|
||||
|
||||
Compress-Archive -Path $release -DestinationPath build\windows\Output\Gopeed-$env:VERSION-windows-amd64.zip
|
||||
New-Item -Path build\windows\Output -ItemType Directory
|
||||
Compress-Archive -Path "$release*" -DestinationPath build\windows\Output\Gopeed-$env:VERSION-windows-amd64.zip
|
||||
|
||||
cd build/windows
|
||||
echo @"
|
||||
@@ -101,12 +100,12 @@ jobs:
|
||||
- name: Upload
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||
asset_path: ui/flutter/build/windows/Output/*
|
||||
overwrite: true
|
||||
build-macos-arm64-lib:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -136,7 +135,7 @@ jobs:
|
||||
path: libgopeed.dylib
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
needs: [release, build-macos-arm64-lib]
|
||||
needs: [get-release, build-macos-arm64-lib]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -155,7 +154,7 @@ jobs:
|
||||
path: ui/flutter/macos/Frameworks
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
PROJECT_DIR=$(pwd)
|
||||
|
||||
@@ -184,12 +183,12 @@ jobs:
|
||||
- name: Upload
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||
asset_path: ui/flutter/build/macos/Build/Products/Release/dist/*
|
||||
overwrite: true
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -202,7 +201,7 @@ jobs:
|
||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/monkeyWie/gopeed/bind/desktop
|
||||
cd ui/flutter
|
||||
@@ -243,12 +242,12 @@ jobs:
|
||||
- name: Upload
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||
asset_path: ui/flutter/debian/packages/*
|
||||
overwrite: true
|
||||
build-android:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -262,7 +261,7 @@ jobs:
|
||||
- uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
mkdir ui/flutter/android/app/libs
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
@@ -275,12 +274,12 @@ jobs:
|
||||
- name: Upload
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||
asset_path: ui/flutter/dist/*
|
||||
overwrite: true
|
||||
build-web:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
@@ -290,7 +289,7 @@ jobs:
|
||||
- uses: subosito/flutter-action@v2
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
cd ui/flutter
|
||||
flutter build web
|
||||
@@ -317,21 +316,21 @@ jobs:
|
||||
- name: Upload
|
||||
uses: shogo82148/actions-upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
upload_url: ${{ needs.get-release.outputs.upload_url }}
|
||||
asset_path: dist/zip/*
|
||||
overwrite: true
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get_release]
|
||||
needs: [get-release]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
env:
|
||||
VERSION: ${{ needs.get_release.outputs.tag_name }}
|
||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||
run: |
|
||||
tag=liwei2633/gopeed:${VERSION:1}
|
||||
docker build -t $tag .
|
||||
docker login -u liwei2633 -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker push $tag
|
||||
docker tag $tag liwei2633/gopeed:latest
|
||||
docker push liwei2633/gopeed:latest
|
||||
docker push liwei2633/gopeed:latest
|
||||
@@ -4,15 +4,16 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/release.yml"
|
||||
- "!.github/release-drafter.yml"
|
||||
- "_docs/**"
|
||||
- "_examples/**"
|
||||
- "README*.md"
|
||||
- ".gitignore"
|
||||
- "ui/flutter/.gitignore"
|
||||
paths:
|
||||
- "bind/**"
|
||||
- "cmd/**"
|
||||
- "internal/**"
|
||||
- "pkg/**"
|
||||
- "ui/**"
|
||||
- ".github/workflows/release.yml"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "Dockerfile"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
|
||||
+18
-16
@@ -4,25 +4,27 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/test.yml"
|
||||
- "_docs/**"
|
||||
- "_examples/**"
|
||||
- "README*.md"
|
||||
- ".gitignore"
|
||||
- "ui/flutter/.gitignore"
|
||||
paths:
|
||||
- "bind/**"
|
||||
- "cmd/**"
|
||||
- "internal/**"
|
||||
- "pkg/**"
|
||||
- "ui/**"
|
||||
- ".github/workflows/test.yml"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/test.yml"
|
||||
- "_docs/**"
|
||||
- "_examples/**"
|
||||
- "README*.md"
|
||||
- ".gitignore"
|
||||
- "ui/flutter/.gitignore"
|
||||
paths:
|
||||
- "bind/**"
|
||||
- "cmd/**"
|
||||
- "internal/**"
|
||||
- "pkg/**"
|
||||
- "ui/**"
|
||||
- ".github/workflows/test.yml"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
|
||||
jobs:
|
||||
# lint:
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ WORKDIR /app
|
||||
COPY ./go.mod ./go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
COPY --from=flutter /app/build/web/* ./cmd/web/dist
|
||||
RUN go build -tags nosqlite,web -ldflags="-s -w" -o dist/gopeed github.com/monkeyWie/gopeed/cmd/web
|
||||
COPY --from=flutter /app/build/web ./cmd/web/dist
|
||||
RUN CGO_ENABLED=0 go build -tags nosqlite,web -ldflags="-s -w" -o dist/gopeed github.com/monkeyWie/gopeed/cmd/web
|
||||
|
||||
FROM alpine:3.14.2
|
||||
LABEL maintainer="monkeyWie"
|
||||
|
||||
@@ -25,6 +25,8 @@ Gopeed is a high-speed downloader developed by `Golang`+`Flutter`, which support
|
||||
|
||||
[To Release](https://github.com/monkeyWie/gopeed/releases/latest)
|
||||
|
||||
> Tips: If the macos open failed, please execute the `xattr -d com.apple.quarantine /Applications/Gopeed.app` command in the terminal
|
||||
|
||||
### Command tool
|
||||
|
||||
use `go install`:
|
||||
@@ -36,7 +38,7 @@ go install github.com/monkeyWie/gopeed/cmd/gopeed
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run liwei2633/gopeed:latest -v /path/to/download:/download -p 9999:9999
|
||||
docker run -d -p 9999:9999 -v /path/to/download:/download liwei2633/gopeed
|
||||
```
|
||||
|
||||
When the docker container is running, you can access the web page through `http://localhost:9999`.
|
||||
|
||||
+3
-1
@@ -25,6 +25,8 @@ Gopeed 是一款由`Golang`+`Flutter`开发的高速下载器,支持(HTTP、
|
||||
|
||||
[点击前往](https://github.com/monkeyWie/gopeed/releases/latest)
|
||||
|
||||
> 注:macos 版本运行如果提示损坏,请在终端执行 `xattr -d com.apple.quarantine /Applications/Gopeed.app` 命令
|
||||
|
||||
### 命令行工具
|
||||
|
||||
使用`go install`安装:
|
||||
@@ -36,7 +38,7 @@ go install github.com/monkeyWie/gopeed/cmd/gopeed
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run liwei2633/gopeed:latest -v /path/to/download:/download -p 9999:9999
|
||||
docker run -d -p 9999:9999 -v /path/to/download:/download liwei2633/gopeed
|
||||
```
|
||||
|
||||
当 docker 容器运行时,可以通过 `http://localhost:9999` 访问 web 页面。
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ func main() {
|
||||
}
|
||||
cfg := &model.StartConfig{
|
||||
Network: "tcp",
|
||||
Address: "127.0.0.1:9999",
|
||||
Address: "0.0.0.0:9999",
|
||||
Storage: model.StorageBolt,
|
||||
WebEnable: true,
|
||||
WebFS: sub,
|
||||
|
||||
@@ -13,7 +13,7 @@ class Setting {
|
||||
String host = "127.0.0.1";
|
||||
int port = 0;
|
||||
int connections = 0;
|
||||
String downloadDir = "";
|
||||
late String downloadDir;
|
||||
late ThemeMode themeMode;
|
||||
late String locale;
|
||||
|
||||
@@ -44,10 +44,6 @@ class Setting {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
if (Util.isWeb()) {
|
||||
downloadDir = "./";
|
||||
return;
|
||||
}
|
||||
if (Util.isAndroid()) {
|
||||
downloadDir =
|
||||
'${await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS)}/com.gopeed';
|
||||
@@ -55,6 +51,9 @@ class Setting {
|
||||
}
|
||||
|
||||
if (downloadDir.isEmpty) {
|
||||
if (Util.isWeb()) {
|
||||
downloadDir = './';
|
||||
}
|
||||
if (Util.isDesktop()) {
|
||||
downloadDir = (await getDownloadsDirectory())!.path;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user