From b76cab97db4912e85f7a74280a884034121c898b Mon Sep 17 00:00:00 2001 From: imbytecat Date: Tue, 8 Jul 2025 00:20:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E9=85=8D=E7=BD=AE=E4=B8=BA=E4=BD=BF=E7=94=A8Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新工作流配置为使用Docker进行编译、登录和推送操作。 --- .gitea/workflows/build.yaml | 41 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f927da8..5f8df42 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -6,31 +6,32 @@ on: - main workflow_dispatch: +env: + DOCKER_REGISTRY: git.furtherverse.com + IMAGE_NAME: ${{ github.repository }} + jobs: compile-dll: name: Compile DLL runs-on: ubuntu-latest - container: - image: greyltc/archlinux-aur:yay steps: - - name: Install dependencies - run: | - yay -Syu --noconfirm cmake python nodejs + - name: Checkout code + uses: actions/checkout@v4 - - name: Clone repository - run: | - git clone https://github.com/swigger/wechat-ocr.git wcocr + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Fix Protobuf version - run: | - sed -i 's/v3.21.0/v3.21.2/g' wcocr/CMakeLists.txt - - - name: Build - run: | - mkdir -p wcocr/build && cd wcocr/build && cmake .. && make -j$(nproc) - - - name: Upload artifacts - uses: christopherhx/gitea-upload-artifact@v4 + - name: Login to Docker Registry + uses: docker/login-action@v3 with: - name: libwcocr - path: wcocr/build/libwcocr.so + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: docker/Dockerfile + push: true + tags: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest-${{ env.ARCH }}