diff options
author | rustdesk <[email protected]> | 2023-07-05 23:45:50 +0800 |
---|---|---|
committer | rustdesk <[email protected]> | 2023-07-05 23:45:50 +0800 |
commit | d3a459542de26a916dc12c8c3b2a8598d74bdab7 (patch) | |
tree | 0b18604008e88cd62c3c67d5c4dff31830ae0ecf /.github | |
parent | afeebe852d0f4a4bbb2659db37b1a889c0a3a8b5 (diff) | |
download | rustdesk-server-d3a459542de26a916dc12c8c3b2a8598d74bdab7.tar.gz rustdesk-server-d3a459542de26a916dc12c8c3b2a8598d74bdab7.zip |
make classic also multiarch
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yaml | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0c75b9e..8ee51b8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -321,20 +321,21 @@ jobs: extra-images: ${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-amd64,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-armv7,${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-i386 push: true - - # docker build and push of classic images + # docker build and push of single-arch images docker-classic: - name: Docker push classic - ${{ matrix.job.name }} + name: Docker push - ${{ matrix.job.name }} needs: build runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: job: - - { name: "amd64", docker_platform: "linux/amd64", tag: "latest" } - - { name: "arm64v8", docker_platform: "linux/arm64", tag: "latest-arm64v8" } + - { name: "amd64", docker_platform: "linux/amd64" } + - { name: "arm64v8", docker_platform: "linux/arm64" } + - { name: "armv7", docker_platform: "linux/arm/v7" } + - { name: "i386", docker_platform: "linux/386" } steps: @@ -348,7 +349,7 @@ jobs: path: docker-classic/ - name: Make binaries executable - run: chmod -v a+x docker-classic/hbb* + run: chmod -v a+x docker-classic/* - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -369,6 +370,14 @@ jobs: with: images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE_CLASSIC }} + - name: Get git tag + id: vars + run: | + T=${GITHUB_REF#refs/*/} + M=${T%%.*} + echo "GIT_TAG=$T" >> $GITHUB_ENV + echo "MAJOR_TAG=$M" >> $GITHUB_ENV + - name: Build and push Docker image uses: docker/build-push-action@v3 with: @@ -376,9 +385,61 @@ jobs: platforms: ${{ matrix.job.docker_platform }} push: true tags: | - ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ matrix.job.tag }} + ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }} + ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-${{ matrix.job.name }} + ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-${{ matrix.job.name }} labels: ${{ steps.meta.outputs.labels }} + # docker build and push of multiarch images + docker-manifest-classic: + + name: Docker manifest + needs: docker + runs-on: ubuntu-22.04 + + steps: + + - name: Log in to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Get git tag + id: vars + run: | + T=${GITHUB_REF#refs/*/} + M=${T%%.*} + echo "GIT_TAG=$T" >> $GITHUB_ENV + echo "MAJOR_TAG=$M" >> $GITHUB_ENV + + # manifest for :1.2.3 tag + # this has to run only if invoked by a new tag + - name: Create and push manifest (:ve.rs.ion) + uses: Noelware/docker-manifest-action@master + if: github.event_name != 'workflow_dispatch' + with: + base-image: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }} + extra-images: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-armv7,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-i386 + push: true + + # manifest for :1 tag (major release) + - name: Create and push manifest (:major) + uses: Noelware/docker-manifest-action@master + with: + base-image: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }} + extra-images: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-armv7,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-i386 + push: true + + # manifest for :latest tag + - name: Create and push manifest (:latest) + uses: Noelware/docker-manifest-action@master + with: + base-image: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }} + extra-images: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-armv7,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-i386 + push: true + deb-package: |