From 58fd9d4ff358c6d2425f4c17ef0ef0bdccf383cc Mon Sep 17 00:00:00 2001 From: Martin Nonnenmacher Date: Tue, 26 Sep 2023 21:12:50 +0200 Subject: [PATCH] chore: Fix formatting of workflow files Fix mainly indentation but also some other formatting issues. Signed-off-by: Martin Nonnenmacher --- .github/actions/ortdocker/action.yml | 106 +++-- .github/workflows/docker-ort-runtime-ext.yml | 356 ++++++++--------- .github/workflows/docker-ort-runtime.yml | 386 +++++++++---------- 3 files changed, 423 insertions(+), 425 deletions(-) diff --git a/.github/actions/ortdocker/action.yml b/.github/actions/ortdocker/action.yml index 74d9a2f48d9a5..e851c2c4990b5 100644 --- a/.github/actions/ortdocker/action.yml +++ b/.github/actions/ortdocker/action.yml @@ -40,63 +40,61 @@ runs: using: "composite" steps: - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + cache: 'pip' - - name: Check if Docker image tag exists - id: check_image - shell: bash - env: - INPUT_REGISTRY: ${{ inputs.registry }} - INPUT_TOKEN: ${{ inputs.token }} - INPUT_NAME: ${{ inputs.name }} - INPUT_VERSION: ${{ inputs.version }} - run: | - pip install -q -U pip requests + - name: Check if Docker image tag exists + id: check_image + shell: bash + env: + INPUT_REGISTRY: ${{ inputs.registry }} + INPUT_TOKEN: ${{ inputs.token }} + INPUT_NAME: ${{ inputs.name }} + INPUT_VERSION: ${{ inputs.version }} + run: | + pip install -q -U pip requests - result=$(python ./.github/actions/ortdocker/check_image.py) - echo $result - echo "result=$result" >> $GITHUB_OUTPUT + result=$(python ./.github/actions/ortdocker/check_image.py) + echo $result + echo "result=$result" >> $GITHUB_OUTPUT - - name: Set up Docker build - if: steps.check_image.outputs.result != 'found' - uses: docker/setup-buildx-action@v2 + - name: Set up Docker build + if: steps.check_image.outputs.result != 'found' + uses: docker/setup-buildx-action@v2 - - name: Login to GitHub container registry - if: steps.check_image.outputs.result != 'found' - uses: docker/login-action@v2 - with: - registry: ${{ inputs.registry }} - username: ${{ github.actor }} - password: ${{ inputs.token }} - - - name: Extract components metadata (tags, labels) - if: steps.check_image.outputs.result != 'found' - id: meta - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }} - tags: - type=raw,value=${{ inputs.version }} - - - name: Build image - if: steps.check_image.outputs.result != 'found' - uses: docker/build-push-action@v4 - with: - context: . - target: ${{ inputs.name }} - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - build-args: ${{ inputs.build-args }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }}:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - base=docker-image://${{ inputs.registry }}/${{ github.repository }}/base:latest + - name: Login to GitHub container registry + if: steps.check_image.outputs.result != 'found' + uses: docker/login-action@v2 + with: + registry: ${{ inputs.registry }} + username: ${{ github.actor }} + password: ${{ inputs.token }} + - name: Extract components metadata (tags, labels) + if: steps.check_image.outputs.result != 'found' + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }} + tags: + type=raw,value=${{ inputs.version }} + - name: Build image + if: steps.check_image.outputs.result != 'found' + uses: docker/build-push-action@v4 + with: + context: . + target: ${{ inputs.name }} + push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + load: false + build-args: ${{ inputs.build-args }} + tags: | + ${{ steps.meta.outputs.tags }} + ${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }}:latest + labels: ${{ steps.meta.outputs.labels }} + build-contexts: | + base=docker-image://${{ inputs.registry }}/${{ github.repository }}/base:latest diff --git a/.github/workflows/docker-ort-runtime-ext.yml b/.github/workflows/docker-ort-runtime-ext.yml index c78711cd8e765..c664f7d2c4e99 100644 --- a/.github/workflows/docker-ort-runtime-ext.yml +++ b/.github/workflows/docker-ort-runtime-ext.yml @@ -1,4 +1,4 @@ - # Copyright (C) 2023 The ORT Project Authors (see ) +# Copyright (C) 2023 The ORT Project Authors (see ) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,186 +18,186 @@ name: Mega Docker extended image on: - workflow_dispatch: - pull_request: - paths: - - '.versions' - - 'Dockerfile' - - 'Dockerfile-extended' - push: - branches: - - main - tags: - - '*' - workflow_run: - workflows: - - 'Mega Docker runtime image' - types: - - completed + workflow_dispatch: + pull_request: + paths: + - '.versions' + - 'Dockerfile' + - 'Dockerfile-extended' + push: + branches: + - main + tags: + - '*' + workflow_run: + workflows: + - 'Mega Docker runtime image' + types: + - completed env: - REGISTRY: ghcr.io + REGISTRY: ghcr.io permissions: write-all jobs: - android_image: - name: Android image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Android image - uses: ./.github/actions/ortdocker - with: - name: android - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.ANDROID_CMD_VERSION }}" - build-args: | - ANDROID_CMD_VERSION=${{ env.ANDROID_CMD_VERSION }} - - dart_image: - name: Dart image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Dart image - uses: ./.github/actions/ortdocker - with: - name: dart - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.DART_VERSION }}" - build-args: | - DART_VERSION=${{ env.DART_VERSION }} - - dotnet_image: - name: Dotnet image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Dotnet image - uses: ./.github/actions/ortdocker - with: - name: dotnet - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.DOTNET_VERSION }}" - build-args: | - DOTNET_VERSION=${{ env.DOTNET_VERSION }} - NUGET_INSPECTOR_VERSION=${{ env.NUGET_INSPECTOR_VERSION }} - - haskell_image: - name: Haskell image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Haskell image - uses: ./.github/actions/ortdocker - with: - name: haskell - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.HASKELL_STACK_VERSION }}" - build-args: | - HASKELL_STACK_VERSION=${{ env.HASKELL_STACK_VERSION }} - - scala_image: - name: Scala image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Scala image - uses: ./.github/actions/ortdocker - with: - name: scala - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.SBT_VERSION }}" - build-args: | - SBT_VERSION=${{ env.SBT_VERSION }} - - swift_image: - name: Swift image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Swift image - uses: ./.github/actions/ortdocker - with: - name: swift - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.SWIFT_VERSION }}" - build-args: | - SWIFT_VERSION=${{ env.SWIFT_VERSION }} - - runtime_extended_image: - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - name: Build ORT extended image - needs: [ android_image, dart_image, dotnet_image, haskell_image, scala_image, swift_image ] - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - - name: Set up Docker build - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract components metadata (tags, labels) - id: meta-ort - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended - tags: | - type=raw,sha,enable=true,format=short - - - name: Build ORT extended runtime image - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile-extended - push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - load: false - tags: | - ${{ steps.meta-ort.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - ort=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest - android=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/android:latest - swift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/swift:latest - scala=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/scala:latest - dart=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dart:latest - dotnet=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dotnet:latest - haskell=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/haskell:latest + android_image: + name: Android image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Android image + uses: ./.github/actions/ortdocker + with: + name: android + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.ANDROID_CMD_VERSION }}" + build-args: | + ANDROID_CMD_VERSION=${{ env.ANDROID_CMD_VERSION }} + + dart_image: + name: Dart image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Dart image + uses: ./.github/actions/ortdocker + with: + name: dart + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.DART_VERSION }}" + build-args: | + DART_VERSION=${{ env.DART_VERSION }} + + dotnet_image: + name: Dotnet image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Dotnet image + uses: ./.github/actions/ortdocker + with: + name: dotnet + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.DOTNET_VERSION }}" + build-args: | + DOTNET_VERSION=${{ env.DOTNET_VERSION }} + NUGET_INSPECTOR_VERSION=${{ env.NUGET_INSPECTOR_VERSION }} + + haskell_image: + name: Haskell image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Haskell image + uses: ./.github/actions/ortdocker + with: + name: haskell + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.HASKELL_STACK_VERSION }}" + build-args: | + HASKELL_STACK_VERSION=${{ env.HASKELL_STACK_VERSION }} + + scala_image: + name: Scala image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Scala image + uses: ./.github/actions/ortdocker + with: + name: scala + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.SBT_VERSION }}" + build-args: | + SBT_VERSION=${{ env.SBT_VERSION }} + + swift_image: + name: Swift image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Swift image + uses: ./.github/actions/ortdocker + with: + name: swift + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.SWIFT_VERSION }}" + build-args: | + SWIFT_VERSION=${{ env.SWIFT_VERSION }} + + runtime_extended_image: + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + name: Build ORT extended image + needs: [ android_image, dart_image, dotnet_image, haskell_image, scala_image, swift_image ] + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + + - name: Set up Docker build + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract components metadata (tags, labels) + id: meta-ort + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended + tags: | + type=raw,sha,enable=true,format=short + + - name: Build ORT extended runtime image + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile-extended + push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + load: false + tags: | + ${{ steps.meta-ort.outputs.tags }} + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended:latest + labels: ${{ steps.meta.outputs.labels }} + build-contexts: | + ort=docker-image://${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest + android=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/android:latest + swift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/swift:latest + scala=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/scala:latest + dart=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dart:latest + dotnet=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dotnet:latest + haskell=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/haskell:latest diff --git a/.github/workflows/docker-ort-runtime.yml b/.github/workflows/docker-ort-runtime.yml index ef800a2a64f89..6c27b2b9c2833 100644 --- a/.github/workflows/docker-ort-runtime.yml +++ b/.github/workflows/docker-ort-runtime.yml @@ -1,4 +1,4 @@ - # Copyright (C) 2023 The ORT Project Authors (see ) +# Copyright (C) 2023 The ORT Project Authors (see ) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,201 +18,201 @@ name: Mega Docker runtime image on: - workflow_dispatch: - pull_request: - paths: - - '.versions' - - 'Dockerfile' - push: - branches: - - main - tags: - - '*' + workflow_dispatch: + pull_request: + paths: + - '.versions' + - 'Dockerfile' + push: + branches: + - main + tags: + - '*' env: - REGISTRY: ghcr.io + REGISTRY: ghcr.io permissions: write-all jobs: - base_image: - name: Base image - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build base image - uses: ./.github/actions/ortdocker - with: - name: base - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.JAVA_VERSION }}-jdk-${{ env.UBUNTU_VERSION }}" - build-args: | - JAVA_VERSION=${{ env.JAVA_VERSION }} - UBUNTU_VERSION=${{ env.UBUNTU_VERSION }} - - nodejs_image: - name: NodeJS image - needs: [base_image] - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build NodeJS image - uses: ./.github/actions/ortdocker - with: - name: nodejs - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.NODEJS_VERSION }}" - build-args: | - NODEJS_VERSION=${{ env.NODEJS_VERSION }} - NPM_VERSION=${{ env.NPM_VERSION }} - PNPM_VERSION=${{ env.PNPM_VERSION }} - YARN_VERSION=${{ env.YARN_VERSION }} - - python_image: - name: Python image - needs: [base_image] - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Python image - uses: ./.github/actions/ortdocker - with: - name: python - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.PYTHON_VERSION }}" - build-args: | - CONAN_VERSION=${{ env.CONAN_VERSION }} - PIPTOOL_VERSION=${{ env.PIPTOOL_VERSION }} - PYENV_GIT_TAG=${{ env.PYENV_GIT_TAG }} - PYTHON_INSPECTOR_VERSION=${{ env.PYTHON_INSPECTOR_VERSION }} - PYTHON_PIPENV_VERSION=${{ env.PYTHON_PIPENV_VERSION }} - PYTHON_POETRY_VERSION=${{ env.PYTHON_POETRY_VERSION }} - PYTHON_VERSION=${{ env.PYTHON_VERSION }} - SCANCODE_VERSION=${{ env.SCANCODE_VERSION }} - - rust_image: - name: Rust image - needs: [base_image] - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Rust image - uses: ./.github/actions/ortdocker - with: - name: rust - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.RUST_VERSION }}" - build-args: | - RUST_VERSION=${{ env.RUST_VERSION }} - - ruby_image: - name: Ruby image - needs: [base_image] - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Ruby image - uses: ./.github/actions/ortdocker - with: - name: ruby - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.RUBY_VERSION }}" - build-args: | - RUBY_VERSION=${{ env.RUBY_VERSION }} - COCOAPODS_VERSION=${{ env.COCOAPODS_VERSION }} - - golang_image: - name: Golang image - needs: [base_image] - runs-on: ubuntu-22.04 - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - name: Build Golang image - uses: ./.github/actions/ortdocker - with: - name: golang - token: ${{ secrets.GITHUB_TOKEN }} - version: "${{ env.GO_VERSION }}" - build-args: | - GO_DEP_VERSION=${{ env.GO_DEP_VERSION }} - GO_VERSION=${{ env.GO_VERSION }} - - runtime_image: - needs: [base_image, nodejs_image, python_image, rust_image, ruby_image, golang_image] - name: Build ORT runtime image - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - name: Checkout default branch - uses: actions/checkout@v3 - - - name: Set environment variables - run: | - cat .versions >> $GITHUB_ENV - - - name: Set up Docker build - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract components metadata (tags, labels) - id: meta-ort - uses: docker/metadata-action@v4 - with: - images: | - ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort - tags: | - type=raw,sha,enable=true,format=short - - - name: Build ORT runtime image - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - uses: docker/build-push-action@v4 - with: - context: . - target: run - push: true - load: false - build-args: | - NODEJS_VERSION=${{ env.NODEJS_VERSION }} - tags: | - ${{ steps.meta-ort.outputs.tags }} - ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest - labels: ${{ steps.meta.outputs.labels }} - build-contexts: | - nodejs=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/nodejs:latest - python=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/python:latest - rust=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/rust:latest - ruby=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/ruby:latest - golang=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/golang:latest + base_image: + name: Base image + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build base image + uses: ./.github/actions/ortdocker + with: + name: base + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.JAVA_VERSION }}-jdk-${{ env.UBUNTU_VERSION }}" + build-args: | + JAVA_VERSION=${{ env.JAVA_VERSION }} + UBUNTU_VERSION=${{ env.UBUNTU_VERSION }} + + nodejs_image: + name: NodeJS image + needs: [ base_image ] + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build NodeJS image + uses: ./.github/actions/ortdocker + with: + name: nodejs + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.NODEJS_VERSION }}" + build-args: | + NODEJS_VERSION=${{ env.NODEJS_VERSION }} + NPM_VERSION=${{ env.NPM_VERSION }} + PNPM_VERSION=${{ env.PNPM_VERSION }} + YARN_VERSION=${{ env.YARN_VERSION }} + + python_image: + name: Python image + needs: [ base_image ] + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Python image + uses: ./.github/actions/ortdocker + with: + name: python + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.PYTHON_VERSION }}" + build-args: | + CONAN_VERSION=${{ env.CONAN_VERSION }} + PIPTOOL_VERSION=${{ env.PIPTOOL_VERSION }} + PYENV_GIT_TAG=${{ env.PYENV_GIT_TAG }} + PYTHON_INSPECTOR_VERSION=${{ env.PYTHON_INSPECTOR_VERSION }} + PYTHON_PIPENV_VERSION=${{ env.PYTHON_PIPENV_VERSION }} + PYTHON_POETRY_VERSION=${{ env.PYTHON_POETRY_VERSION }} + PYTHON_VERSION=${{ env.PYTHON_VERSION }} + SCANCODE_VERSION=${{ env.SCANCODE_VERSION }} + + rust_image: + name: Rust image + needs: [ base_image ] + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Rust image + uses: ./.github/actions/ortdocker + with: + name: rust + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.RUST_VERSION }}" + build-args: | + RUST_VERSION=${{ env.RUST_VERSION }} + + ruby_image: + name: Ruby image + needs: [ base_image ] + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Ruby image + uses: ./.github/actions/ortdocker + with: + name: ruby + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.RUBY_VERSION }}" + build-args: | + RUBY_VERSION=${{ env.RUBY_VERSION }} + COCOAPODS_VERSION=${{ env.COCOAPODS_VERSION }} + + golang_image: + name: Golang image + needs: [ base_image ] + runs-on: ubuntu-22.04 + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + - name: Build Golang image + uses: ./.github/actions/ortdocker + with: + name: golang + token: ${{ secrets.GITHUB_TOKEN }} + version: "${{ env.GO_VERSION }}" + build-args: | + GO_DEP_VERSION=${{ env.GO_DEP_VERSION }} + GO_VERSION=${{ env.GO_VERSION }} + + runtime_image: + needs: [ base_image, nodejs_image, python_image, rust_image, ruby_image, golang_image ] + name: Build ORT runtime image + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + + steps: + - name: Checkout default branch + uses: actions/checkout@v3 + + - name: Set environment variables + run: | + cat .versions >> $GITHUB_ENV + + - name: Set up Docker build + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract components metadata (tags, labels) + id: meta-ort + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort + tags: | + type=raw,sha,enable=true,format=short + + - name: Build ORT runtime image + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + uses: docker/build-push-action@v4 + with: + context: . + target: run + push: true + load: false + build-args: | + NODEJS_VERSION=${{ env.NODEJS_VERSION }} + tags: | + ${{ steps.meta-ort.outputs.tags }} + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:latest + labels: ${{ steps.meta.outputs.labels }} + build-contexts: | + nodejs=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/nodejs:latest + python=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/python:latest + rust=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/rust:latest + ruby=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/ruby:latest + golang=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/golang:latest