Skip to content

Commit

Permalink
fix(docker): Set correct version for runtime
Browse files Browse the repository at this point in the history
Main version is caught in the same manner as the
docker_build script, with gradlew.
Tag event will create the version with defined tag.

Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Sep 26, 2023
1 parent 114c153 commit 832bcb1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker-ort-runtime-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ on:
- '.versions'
- 'Dockerfile'
- 'Dockerfile-extended'
- '.github/workflows/docker-ort-runtime.yml'
- '.github/workflows/docker-ort-runtime-ext.yml'
push:
branches:
- main
Expand Down Expand Up @@ -163,6 +165,11 @@ jobs:
- name: Checkout default branch
uses: actions/checkout@v4

- 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@v2

Expand All @@ -180,7 +187,9 @@ jobs:
images: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended
tags: |
type=raw,sha,enable=true,format=short
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
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/docker-ort-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
paths:
- '.versions'
- 'Dockerfile'
- '.github/workflows/docker-ort-runtime.yml'
push:
branches:
- main
Expand Down Expand Up @@ -177,6 +178,11 @@ jobs:
run: |
cat .versions >> $GITHUB_ENV
- 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@v2

Expand All @@ -194,7 +200,9 @@ jobs:
images: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/ort
tags: |
type=raw,sha,enable=true,format=short
type=schedule,pattern={{date 'YYYYMMDD'}}
type=pep440,pattern={{version}}
type=raw,value=${{ env.ORT_VERSION }}
- name: Build ORT runtime image
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
Expand Down

0 comments on commit 832bcb1

Please sign in to comment.