From edd0a05a251a442cc4807638e8c07c8afc790e01 Mon Sep 17 00:00:00 2001 From: drivebyer Date: Tue, 26 Mar 2024 17:49:46 +0800 Subject: [PATCH] add ci builder --- .github/workflows/release_manually.yml | 32 ++++++++++++++++++++++++++ arm64/images/ci-builder/Dockerfile | 17 ++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 arm64/images/ci-builder/Dockerfile diff --git a/.github/workflows/release_manually.yml b/.github/workflows/release_manually.yml index 0ef502aa6..f82fd2060 100644 --- a/.github/workflows/release_manually.yml +++ b/.github/workflows/release_manually.yml @@ -25,6 +25,7 @@ on: - 'ot-redis-upstream' - 'zoo-entrance' - 'logical-backup' + - 'ci-builder' upstream-ref: description: 'upstream ref' required: false @@ -40,6 +41,37 @@ env: BUILD_PLATFORM: linux/amd64,linux/arm64 jobs: + ci-builder: + if : ${{ inputs.job == 'ci-builder' }} + runs-on: ubuntu-latest + steps: + - name: Git clone repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.0.0 + - name: ci-builder + uses: docker/build-push-action@v3.1.1 + with: + context: ./arm64/images/ci-builder + file: ./arm64/images/ci-builder/Dockerfile + github-token: ${{ secrets.GITHUB_TOKEN }} + push: true + platforms: ${{ env.BUILD_PLATFORM }} + tags: | + ${{ env.ONLINE_REGISTER }}/ci-builder:${{ inputs.tag }} + ${{ env.ONLINE_REGISTER }}/ci-builder:latest + cache-from: type=gha + cache-to: type=gha,mode=max logical-backup: if : ${{ inputs.job == 'logical-backup' }} runs-on: ubuntu-latest diff --git a/arm64/images/ci-builder/Dockerfile b/arm64/images/ci-builder/Dockerfile new file mode 100644 index 000000000..c7e26fccd --- /dev/null +++ b/arm64/images/ci-builder/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.21.8-alpine3.19 + +# install make +RUN apk upgrade --no-cache && \ + apk add --no-cache make protobuf && \ + go env -w GOPROXY=https://goproxy.cn,direct && \ + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 && \ + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 && \ + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.10.0 && \ + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.10.0 && \ + go install github.com/golang/mock/mockgen@v1.6.0 && \ + go install github.com/jstemmer/go-junit-report@latest && \ + go install github.com/grpc-ecosystem/protoc-gen-grpc-gateway-ts@v1.1.1 && \ + go install github.com/favadi/protoc-go-inject-tag@latest && \ + go install github.com/go-swagger/go-swagger/cmd/swagger@v0.29.0 + +ENTRYPOINT ["/bin/sh"]