From a155bc64c00533806ee8f62fc2836c5846e5d791 Mon Sep 17 00:00:00 2001 From: qaq <1937228092@qq.com> Date: Tue, 25 Nov 2025 09:43:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A8=B3=E5=AE=9A=E7=89=88ar?= =?UTF-8?q?m=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 181 +++++++++++++++++++++++------ README.md | 37 +++++- 2 files changed, 178 insertions(+), 40 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index c27a6f7..695ce69 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -17,30 +17,45 @@ jobs: outputs: version: ${{ env.VERSION }} should_build: ${{ steps.check-tag.outputs.should_build }} + should_build_gost: ${{ steps.check-tag.outputs.should_build_gost }} + tag_exists: ${{ steps.check-tag.outputs.tag_exists }} steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 # 获取所有历史和 tags + fetch-depth: 0 - name: Display version run: | echo "Current version: ${{ env.VERSION }}" - - name: Check if tag exists + - name: Check if tag exists and detect changes id: check-tag run: | if git rev-parse "${{ env.VERSION }}" >/dev/null 2>&1; then - echo "Tag ${{ env.VERSION }} already exists, skip build" + echo "Tag ${{ env.VERSION }} already exists" + echo "tag_exists=true" >> $GITHUB_OUTPUT echo "should_build=false" >> $GITHUB_OUTPUT + + # 检查从tag到现在,go-gost目录下的文件是否有变化 + TAG_COMMIT=$(git rev-list -n 1 "${{ env.VERSION }}") + if git diff --quiet $TAG_COMMIT HEAD -- go-gost/; then + echo "✅ GOST files unchanged since tag" + echo "should_build_gost=false" >> $GITHUB_OUTPUT + else + echo "🔄 GOST files changed since tag, will rebuild GOST binary" + echo "should_build_gost=true" >> $GITHUB_OUTPUT + fi else echo "Tag ${{ env.VERSION }} does not exist, will build all components" echo "should_build=true" >> $GITHUB_OUTPUT + echo "should_build_gost=true" >> $GITHUB_OUTPUT + echo "tag_exists=false" >> $GITHUB_OUTPUT fi build-gost: name: Build & Compress GOST Binary needs: check-version - if: needs.check-version.outputs.should_build == 'true' + if: needs.check-version.outputs.should_build_gost == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -67,21 +82,37 @@ jobs: sudo mv upx-4.2.1-amd64_linux/upx /usr/local/bin/ rm -rf upx-4.2.1-amd64_linux* - - name: Build GOST binary + - name: Build GOST binary (AMD64) working-directory: ./go-gost run: | - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o gost + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o gost-amd64 - - name: Compress with UPX + - name: Build GOST binary (ARM64) working-directory: ./go-gost run: | - upx --best --lzma gost + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o gost-arm64 - - name: Upload GOST artifact + - name: Compress with UPX (AMD64) + working-directory: ./go-gost + run: | + upx --best --lzma gost-amd64 + + - name: Compress with UPX (ARM64) + working-directory: ./go-gost + run: | + upx --best --lzma gost-arm64 + + - name: Upload GOST AMD64 artifact uses: actions/upload-artifact@v4 with: - name: gost-binary - path: ./go-gost/gost + name: gost-binary-amd64 + path: ./go-gost/gost-amd64 + + - name: Upload GOST ARM64 artifact + uses: actions/upload-artifact@v4 + with: + name: gost-binary-arm64 + path: ./go-gost/gost-arm64 build-vite: name: Build & Push Vite Frontend @@ -109,7 +140,7 @@ jobs: run: | VERSION="${{ needs.check-version.outputs.version }}" docker buildx build \ - --platform linux/amd64 \ + --platform linux/amd64,linux/arm64 \ --push \ -t bqlpfy/vite-frontend:latest \ -t bqlpfy/vite-frontend:${VERSION} \ @@ -153,7 +184,7 @@ jobs: run: | VERSION="${{ needs.check-version.outputs.version }}" docker buildx build \ - --platform linux/amd64 \ + --platform linux/amd64,linux/arm64 \ --push \ -t bqlpfy/springboot-backend:latest \ -t bqlpfy/springboot-backend:${VERSION} \ @@ -169,11 +200,22 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download GOST binary + - name: Download GOST AMD64 binary uses: actions/download-artifact@v4 with: - name: gost-binary - path: ./artifacts + name: gost-binary-amd64 + path: ./artifacts/amd64 + + - name: Download GOST ARM64 binary + uses: actions/download-artifact@v4 + with: + name: gost-binary-arm64 + path: ./artifacts/arm64 + + - name: Rename binaries + run: | + mv ./artifacts/amd64/gost-amd64 ./artifacts/gost-amd64 + mv ./artifacts/arm64/gost-arm64 ./artifacts/gost-arm64 - name: Create Release env: @@ -185,39 +227,104 @@ jobs: git tag "${VERSION}" ${{ github.sha }} git push origin "${VERSION}" + # 获取 commit 信息 + COMMIT_MSG=$(git log -1 --pretty=format:"%s") + COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an") + COMMIT_DATE=$(git log -1 --pretty=format:"%ai") + # 创建 release gh release create "${VERSION}" \ --title "Release ${VERSION}" \ - --notes "Version ${VERSION} - - ## Components - - **GOST Binary** (Linux AMD64, compressed with UPX) - - **Vite Frontend** Docker Image: \`bqlpfy/vite-frontend:${VERSION}\` / \`bqlpfy/vite-frontend:latest\` - - **Spring Boot Backend** Docker Image: \`bqlpfy/springboot-backend:${VERSION}\` / \`bqlpfy/springboot-backend:latest\` - - ## Installation Files - - \`install.sh\` - GOST 客户端安装脚本 - - \`panel_install.sh\` - 面板安装脚本 - - \`gost.sql\` - 数据库初始化文件 - - \`docker-compose-v4.yml\` - Docker Compose 配置 (IPv4) - - \`docker-compose-v6.yml\` - Docker Compose 配置 (IPv6) - - ## Details - - Build date: $(date -u +%Y-%m-%dT%H:%M:%SZ) - - Commit: ${{ github.sha }}" \ + --notes "## 📝 Commit Information + - **Message**: ${COMMIT_MSG} + - **Author**: ${COMMIT_AUTHOR} + - **Date**: ${COMMIT_DATE} + - **Commit**: [\`${GITHUB_SHA:0:7}\`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})" \ --repo ${{ github.repository }} # 上传所有文件到 release - echo "📤 上传 GOST 二进制..." - gh release upload "${VERSION}" ./artifacts/gost --clobber + echo "📤 上传 GOST 二进制文件..." + gh release upload "${VERSION}" ./artifacts/gost-amd64 --clobber + gh release upload "${VERSION}" ./artifacts/gost-arm64 --clobber echo "📤 上传安装脚本..." gh release upload "${VERSION}" ./install.sh --clobber gh release upload "${VERSION}" ./panel_install.sh --clobber - echo "📤 上传配置文件..." - gh release upload "${VERSION}" ./gost.sql --clobber + echo "📤 上传 Docker Compose 配置文件..." gh release upload "${VERSION}" ./docker-compose-v4.yml --clobber gh release upload "${VERSION}" ./docker-compose-v6.yml --clobber echo "✅ 所有文件已上传到 Release ${VERSION}" + + update-release-gost: + name: Update GOST Binaries in Release + needs: [check-version, build-gost] + if: needs.check-version.outputs.should_build == 'false' && needs.check-version.outputs.should_build_gost == 'true' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - name: Download GOST AMD64 binary + uses: actions/download-artifact@v4 + with: + name: gost-binary-amd64 + path: ./artifacts/amd64 + + - name: Download GOST ARM64 binary + uses: actions/download-artifact@v4 + with: + name: gost-binary-arm64 + path: ./artifacts/arm64 + + - name: Rename binaries + run: | + mv ./artifacts/amd64/gost-amd64 ./artifacts/gost-amd64 + mv ./artifacts/arm64/gost-arm64 ./artifacts/gost-arm64 + + - name: Update GOST binaries in Release + env: + GH_TOKEN: ${{ github.token }} + run: | + VERSION="${{ needs.check-version.outputs.version }}" + + echo "🔄 更新 Release ${VERSION} 中的 GOST 二进制文件..." + + gh release upload "${VERSION}" ./artifacts/gost-amd64 --clobber + gh release upload "${VERSION}" ./artifacts/gost-arm64 --clobber + + echo "✅ GOST 二进制文件更新完成!" + echo "ℹ️ Docker 镜像未重新构建" + + update-release-files: + name: Update Release Files Only + needs: check-version + if: needs.check-version.outputs.tag_exists == 'true' && needs.check-version.outputs.should_build == 'false' && needs.check-version.outputs.should_build_gost == 'false' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - name: Update Release Files + env: + GH_TOKEN: ${{ github.token }} + run: | + VERSION="${{ needs.check-version.outputs.version }}" + + echo "📤 更新 Release ${VERSION} 中的脚本和配置文件..." + + # 上传安装脚本(覆盖) + echo "📤 更新安装脚本..." + gh release upload "${VERSION}" ./install.sh --clobber + gh release upload "${VERSION}" ./panel_install.sh --clobber + + # 上传 Docker Compose 配置文件(覆盖) + echo "📤 更新 Docker Compose 配置文件..." + gh release upload "${VERSION}" ./docker-compose-v4.yml --clobber + gh release upload "${VERSION}" ./docker-compose-v6.yml --clobber + + echo "✅ 文件更新完成!Release ${VERSION} 中的脚本和配置已更新" + echo "ℹ️ Docker 镜像和 GOST 二进制未重新构建" \ No newline at end of file diff --git a/README.md b/README.md index c9ca2b5..f461e31 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,22 @@ - # flux-panel转发面板 哆啦A梦转发面板 +# 赞助商 +

+ + + + + + + +

+ + + + +使用1.x版本的请使用上面给出的脚本,不要使用最新的,最新的默认2.x +嫌弃麻烦或者想稳定的我不推荐你升级到2.x版本 目前还在beta阶段,很多问题。 + 本项目基于 [go-gost/gost](https://github.com/go-gost/gost) 和 [go-gost/x](https://github.com/go-gost/x) 两个开源库,实现了转发面板。 --- @@ -17,10 +33,26 @@ ## 部署流程 --- ### Docker Compose部署 +#### 快速部署 +面板端(稳定版): ```bash curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/main/panel_install.sh -o panel_install.sh && chmod +x panel_install.sh && ./panel_install.sh ``` +节点端(稳定版): +```bash +curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/main/install.sh -o install.sh && chmod +x install.sh && ./install.sh +``` + +面板端(开发版): +```bash +curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/beta/panel_install.sh -o panel_install.sh && chmod +x panel_install.sh && ./panel_install.sh +``` +节点端(开发版): +```bash +curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/beta/install.sh -o install.sh && chmod +x install.sh && ./install.sh + +``` #### 默认管理员账号 @@ -55,7 +87,7 @@ curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/main/pane 请务必在合法、合规、安全的前提下使用本项目。 --- -## ⭐ 喝杯咖啡! +## ⭐ 喝杯咖啡!(USDT) | 网络 | 地址 | |------------|----------------------------------------------------------------------| @@ -65,4 +97,3 @@ curl -L https://raw.githubusercontent.com/bqlpfy/flux-panel/refs/heads/main/pane [![Star History Chart](https://api.star-history.com/svg?repos=bqlpfy/flux-panel&type=Date)](https://www.star-history.com/#bqlpfy/flux-panel&Date) -