From 5f5e72af9391d2e2599590718c2cadea4e4fabd6 Mon Sep 17 00:00:00 2001 From: Eugene Morozov Date: Wed, 11 Dec 2024 22:06:30 +0200 Subject: [PATCH] Test 32 --- .gitea/workflows/build-amd64.yml | 48 --- .gitea/workflows/build-arm64.yml | 53 ---- .gitea/workflows/build.yml | 444 ++++++++++++++++++++++++--- .gitea/workflows/create-manifest.yml | 41 --- 4 files changed, 394 insertions(+), 192 deletions(-) delete mode 100644 .gitea/workflows/build-amd64.yml delete mode 100644 .gitea/workflows/build-arm64.yml delete mode 100644 .gitea/workflows/create-manifest.yml diff --git a/.gitea/workflows/build-amd64.yml b/.gitea/workflows/build-amd64.yml deleted file mode 100644 index 3fb8cb67..00000000 --- a/.gitea/workflows/build-amd64.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build AMD64 -on: - workflow_call: - inputs: - python-version: - required: true - type: string - -jobs: - build: - runs-on: linux_amd - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - - name: Build and Push AMD64 - id: build-docker - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.python${{ inputs.python-version }} - platforms: linux/amd64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true \ No newline at end of file diff --git a/.gitea/workflows/build-arm64.yml b/.gitea/workflows/build-arm64.yml deleted file mode 100644 index 9e03c053..00000000 --- a/.gitea/workflows/build-arm64.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build ARM64 -on: - workflow_call: - inputs: - python-version: - required: true - type: string - secrets: - DOCKER_USERNAME: - required: true - DOCKER_PASSWORD: - required: true - -jobs: - build: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/arm64 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - - name: Build and Push ARM64 - id: build-docker - uses: docker/build-push-action@v6 - with: - context: . - file: Dockerfile.python${{ inputs.python-version }} - platforms: linux/arm64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true \ No newline at end of file diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3370d06c..e659ee34 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,78 +7,422 @@ on: - cron: '@monthly' jobs: - python-3-10: - name: Build Python 3.10 - runs-on: ubuntu-latest + build-3-10-amd64: + runs-on: linux_amd + name: Build Python 3.10 AMD64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} steps: - - name: Build AMD64 - uses: ./.gitea/workflows/build-amd64.yml + - name: Checkout + uses: actions/checkout@v4 with: - python-version: '3.10' - - - name: Build ARM64 - uses: ./.gitea/workflows/build-arm64.yml + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 with: - python-version: '3.10' - - - name: Create Manifest - uses: ./.gitea/workflows/create-manifest.yml + platforms: linux/amd64 + - name: Login to DockerHub + uses: docker/login-action@v3 with: - python-version: '3.10' + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push AMD64 + id: build-docker + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.python3.10 + platforms: linux/amd64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - python-3-11: - name: Build Python 3.11 + build-3-10-arm64: runs-on: ubuntu-latest + name: Build Python 3.10 ARM64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} steps: - - name: Build AMD64 - uses: ./.gitea/workflows/build-amd64.yml + - name: Checkout + uses: actions/checkout@v4 with: - python-version: '3.11' - - - name: Build ARM64 - uses: ./.gitea/workflows/build-arm64.yml + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 with: - python-version: '3.11' - - - name: Create Manifest - uses: ./.gitea/workflows/create-manifest.yml + platforms: linux/arm64 + - name: Login to DockerHub + uses: docker/login-action@v3 with: - python-version: '3.11' + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push ARM64 + id: build-docker + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.python3.10 + platforms: linux/arm64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - python-3-12: - name: Build Python 3.12 + create-manifest-3-10: + needs: [build-3-10-arm64, build-3-10-amd64] runs-on: ubuntu-latest + name: Create Python 3.10 Manifest steps: - - name: Build AMD64 - uses: ./.gitea/workflows/build-amd64.yml + - name: Login to Docker Registry + uses: docker/login-action@v3 with: - python-version: '3.12' - - - name: Build ARM64 - uses: ./.gitea/workflows/build-arm64.yml + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 with: - python-version: '3.12' + driver: docker-container + - name: Get Repository Metadata + id: meta + run: | + echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Create and Push Multi-arch Manifest + run: | + IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.10 + docker manifest create $IMAGE_NAME \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-10-arm64.outputs.digest }} \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-10-amd64.outputs.digest }} + docker manifest push $IMAGE_NAME - - name: Create Manifest - uses: ./.gitea/workflows/create-manifest.yml + build-3-11-amd64: + runs-on: linux_amd + name: Build Python 3.11 AMD64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 with: - python-version: '3.12' + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push AMD64 + id: build-docker + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.python3.11 + platforms: linux/amd64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - python-3-13: - name: Build Python 3.13 + build-3-11-arm64: runs-on: ubuntu-latest + name: Build Python 3.11 ARM64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} steps: - - name: Build AMD64 - uses: ./.gitea/workflows/build-amd64.yml + - name: Checkout + uses: actions/checkout@v4 with: - python-version: '3.13' + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push ARM64 + id: build-docker + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.python3.11 + platforms: linux/arm64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - name: Build ARM64 - uses: ./.gitea/workflows/build-arm64.yml + create-manifest-3-11: + needs: [build-3-11-arm64, build-3-11-amd64] + runs-on: ubuntu-latest + name: Create Python 3.11 Manifest + steps: + - name: Login to Docker Registry + uses: docker/login-action@v3 with: - python-version: '3.13' + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + - name: Get Repository Metadata + id: meta + run: | + echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Create and Push Multi-arch Manifest + run: | + IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.11 + docker manifest create $IMAGE_NAME \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-11-arm64.outputs.digest }} \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-11-amd64.outputs.digest }} + docker manifest push $IMAGE_NAME - - name: Create Manifest - uses: ./.gitea/workflows/create-manifest.yml + build-3-12-amd64: + runs-on: linux_amd + name: Build Python 3.12 AMD64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 with: - python-version: '3.13' \ No newline at end of file + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push AMD64 + id: build-docker + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.python3.12 + platforms: linux/amd64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + + build-3-12-arm64: + runs-on: ubuntu-latest + name: Build Python 3.12 ARM64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push ARM64 + id: build-docker + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.python3.12 + platforms: linux/arm64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + + create-manifest-3-12: + needs: [build-3-12-arm64, build-3-12-amd64] + runs-on: ubuntu-latest + name: Create Python 3.12 Manifest + steps: + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + - name: Get Repository Metadata + id: meta + run: | + echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Create and Push Multi-arch Manifest + run: | + IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.12 + docker manifest create $IMAGE_NAME \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-12-arm64.outputs.digest }} \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-12-amd64.outputs.digest }} + docker manifest push $IMAGE_NAME + + build-3-13-amd64: + runs-on: linux_amd + name: Build Python 3.13 AMD64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push AMD64 + id: build-docker + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.python3.13 + platforms: linux/amd64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + + build-3-13-arm64: + runs-on: ubuntu-latest + name: Build Python 3.13 ARM64 + container: + image: catthehacker/ubuntu:act-latest + env: + RUNNER_TOOL_CACHE: /toolcache + outputs: + digest: ${{ steps.build-docker.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + github-server-url: https://gitea.technocloud.ee + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get Meta + id: meta + run: | + echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Build and Push ARM64 + id: build-docker + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile.python3.13 + platforms: linux/arm64 + push: true + provenance: false + outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + + create-manifest-3-13: + needs: [build-3-13-arm64, build-3-13-amd64] + runs-on: ubuntu-latest + name: Create Python 3.13 Manifest + steps: + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: gitea.technocloud.ee + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + - name: Get Repository Metadata + id: meta + run: | + echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + - name: Create and Push Multi-arch Manifest + run: | + IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.13 + docker manifest create $IMAGE_NAME \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-13-arm64.outputs.digest }} \ + --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-13-amd64.outputs.digest }} + docker manifest push $IMAGE_NAME \ No newline at end of file diff --git a/.gitea/workflows/create-manifest.yml b/.gitea/workflows/create-manifest.yml deleted file mode 100644 index 8bb9f4a6..00000000 --- a/.gitea/workflows/create-manifest.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create Manifest -on: - workflow_call: - inputs: - python-version: - required: true - type: string - secrets: - DOCKER_USERNAME: - required: true - DOCKER_PASSWORD: - required: true - -jobs: - create: - runs-on: ubuntu-latest - steps: - - name: Login to Docker Registry - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - - name: Get Repository Metadata - id: meta - run: | - echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - - name: Create and Push Multi-arch Manifest - run: | - IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python${{ inputs.python-version }} - docker manifest create $IMAGE_NAME \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${ARM_DIGEST} \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${AMD_DIGEST} - docker manifest push $IMAGE_NAME \ No newline at end of file