- 更新工作流配置为使用Docker进行编译、登录和推送操作。
This commit is contained in:
@@ -6,31 +6,32 @@ on:
|
|||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: git.furtherverse.com
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile-dll:
|
compile-dll:
|
||||||
name: Compile DLL
|
name: Compile DLL
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: greyltc/archlinux-aur:yay
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Checkout code
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
yay -Syu --noconfirm cmake python nodejs
|
|
||||||
|
|
||||||
- name: Clone repository
|
- name: Set up Docker Buildx
|
||||||
run: |
|
uses: docker/setup-buildx-action@v3
|
||||||
git clone https://github.com/swigger/wechat-ocr.git wcocr
|
|
||||||
|
|
||||||
- name: Fix Protobuf version
|
- name: Login to Docker Registry
|
||||||
run: |
|
uses: docker/login-action@v3
|
||||||
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
|
|
||||||
with:
|
with:
|
||||||
name: libwcocr
|
registry: ${{ env.DOCKER_REGISTRY }}
|
||||||
path: wcocr/build/libwcocr.so
|
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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user