-
Notifications
You must be signed in to change notification settings - Fork 314
214 lines (197 loc) · 6.81 KB
/
docker-ort-runtime-ext.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE
name: Docker extended runtime image
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
pull_request:
paths:
- '.versions'
- 'Dockerfile'
- 'Dockerfile-extended'
- '.github/workflows/docker-ort-runtime.yml'
- '.github/workflows/docker-ort-runtime-ext.yml'
push:
tags:
- '*'
workflow_run:
workflows:
- 'Docker runtime image'
types:
- completed
env:
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@v4
- 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@v4
- 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@v4
- 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@v4
- 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@v4
- 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@v4
- 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@v4
with:
fetch-depth: 0
- name: Get ORT current version
run: |
ORT_VERSION=$(./gradlew -q properties --property version | sed -nr "s/version: (.+)/\1/p")
echo "ORT_VERSION=${ORT_VERSION}" >> $GITHUB_ENV
- name: Set up Docker build
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract components metadata (tags, labels)
id: meta-ort
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=pep440,pattern={{version}}
type=raw,value=${{ env.ORT_VERSION }}
- name: Build ORT extended runtime image
uses: docker/build-push-action@v5
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:${{ env.ORT_VERSION }}
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