From b1817ca63f637cc1771ca35ffbc73a00bdd83ded Mon Sep 17 00:00:00 2001 From: ljw <84855512@qq.com> Date: Wed, 23 Oct 2024 09:03:01 +0800 Subject: [PATCH] add armv7l build #21 --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ba10e8..1cc114a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,7 @@ jobs: job: - { platform: "amd64", goos: "linux" } - { platform: "arm64", goos: "linux" } + - { platform: "armv7l", goos: "linux" } - { platform: "amd64", goos: "windows" } steps: @@ -103,6 +104,11 @@ jobs: tar -xf aarch64-linux-musl-cross.tgz export PATH=$PATH:$PWD/aarch64-linux-musl-cross/bin GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=aarch64-linux-musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go + elif [ "${{ matrix.job.platform }}" = "armv7l" ]; then + wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz + tar -xf armv7l-linux-musleabihf-cross.tgz + export PATH=$PATH:$PWD/armv7l-linux-musleabihf-cross/bin + GOOS=${{ matrix.job.goos }} GOARCH=arm GOARM=7 CC=armv7l-linux-musleabihf-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go else sudo apt-get install musl musl-dev musl-tools -y GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go @@ -137,6 +143,7 @@ jobs: job: - { platform: "amd64", goos: "linux", docker_platform: "linux/amd64" } - { platform: "arm64", goos: "linux", docker_platform: "linux/arm64" } + - { platform: "armv7l", goos: "linux", docker_platform: "linux/arm/v7" } steps: - name: Checkout code uses: actions/checkout@v4 @@ -257,6 +264,7 @@ jobs: with: base-image: ${{ env.BASE_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }} extra-images: ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-amd64, + ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-armv7l, ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-arm64 push: true @@ -266,6 +274,7 @@ jobs: with: base-image: ghcr.io/${{ env.BASE_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }} extra-images: ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-amd64, + ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-armv7l, ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:${{ env.TAG }}-arm64 push: true amend: true @@ -276,6 +285,7 @@ jobs: with: base-image: ${{ env.BASE_IMAGE_NAMESPACE }}/rustdesk-api:latest extra-images: ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:latest-amd64, + ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:latest-armv7l, ${{ env.DOCKERHUB_IMAGE_NAMESPACE }}/rustdesk-api:latest-arm64 push: true @@ -285,6 +295,7 @@ jobs: with: base-image: ghcr.io/${{ env.BASE_IMAGE_NAMESPACE }}/rustdesk-api:latest extra-images: ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:latest-amd64, + ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:latest-armv7l, ghcr.io/${{ env.GHCR_IMAGE_NAMESPACE }}/rustdesk-api:latest-arm64 push: true amend: true \ No newline at end of file