From 691e7222264bd198a5fd981194dfb64b0cdba26a Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Fri, 3 Jul 2026 20:29:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA):=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BAOFDGo=20WebUI=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.sh | 5 +++++ .gitea/workflows/build.yaml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 14 ++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .gitea/workflows/build.sh create mode 100644 .gitea/workflows/build.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/build.sh b/.gitea/workflows/build.sh new file mode 100644 index 0000000..55118d9 --- /dev/null +++ b/.gitea/workflows/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e +export TZ=Asia/Shanghai +GOOS=js GOARCH=wasm CGO_ENABLED=0 go build -o assets/webui/ofdgo.wasm -trimpath -ldflags "-s -w -buildid=" ./cmd/webui/wasm.go +GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main -trimpath -ldflags "-s -w -buildid=" ./cmd/webui/webui.go \ No newline at end of file diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..0899c5a --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,32 @@ +on: [push, workflow_dispatch] +jobs: + build: + runs-on: cn + steps: + - name: checkout + uses: actions/checkout@v6 + - name: docker goenv + uses: docker://ccr.ccs.tencentyun.com/xiaoqidun/goenv:latest + with: + args: bash .gitea/workflows/build.sh + - name: docker setup + uses: docker/setup-buildx-action@v3 + with: + driver-opts: | + "env.http_proxy=${{ env.HTTP_PROXY }}" + "env.https_proxy=${{ env.HTTPS_PROXY }}" + "env.no_proxy=${{ env.NO_PROXY }}" + - name: docker login + uses: docker/login-action@v3 + with: + registry: ccr.ccs.tencentyun.com + username: ${{ secrets.docker_username }} + password: ${{ secrets.docker_password }} + - name: docker build + uses: docker/build-push-action@v6 + with: + context: . + push: true + provenance: false + tags: | + ccr.ccs.tencentyun.com/xiaoqidun/ofdgo:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8fe0c4b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# 基础镜像 +FROM alpine:3.24.1 + +# 作者信息 +LABEL authors="肖其顿 (XIAO QI DUN)" + +# 工作路径 +WORKDIR /usr/src/app + +# 复制程序 +COPY main ./main + +# 启动命令 +ENTRYPOINT [ "/usr/src/app/main","-listen",":80"] \ No newline at end of file