From c742a374877ca55c87087c721183008e7e71b2b3 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Fri, 9 Feb 2024 14:33:05 +0100 Subject: [PATCH] Update GH actions to support detection v0 versus calever version coffea and build relevant image instead --- .github/workflows/autotag.yaml | 2 +- .github/workflows/gh-ci.yaml | 27 +++++++++++++++------------ .github/workflows/watch-conda.yaml | 3 ++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/autotag.yaml b/.github/workflows/autotag.yaml index 4521afa..c1b2061 100644 --- a/.github/workflows/autotag.yaml +++ b/.github/workflows/autotag.yaml @@ -14,7 +14,7 @@ jobs: with: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" strategy: regex - regex_pattern: 'releasev0: \"\d+\.\d+\.\d+\"' + regex_pattern: 'releasev0: \"0.\d+\.\d+\"' root: ".github/workflows/gh-ci.yml" - uses: butlerlogic/action-autotag@stable with: diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index f9daeba..da5d768 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -12,7 +12,7 @@ env: DOCKER_ORG: coffeateam GITHUB_SHA: ${{ github.sha }} GITHUB_REF: ${{ github.ref }} - release: "0.7.22" + release: "2024.1.0" releasev0: "0.7.22" jobs: @@ -21,11 +21,11 @@ jobs: strategy: fail-fast: false matrix: - image_dir: [basev0, dask] + image_dir: [coffea-basev0, coffea-dask] distro: [alma8, ubuntu] python: ["3.9", "3.10", "3.11"] exclude: - - image_dir: alma8 + - distro: alma8 python: 3.9 name: ${{ matrix.image_dir }}-${{ matrix.distro }}-${{ matrix.python }} runs-on: ubuntu-latest @@ -64,29 +64,32 @@ jobs: python: ${{ matrix.python }} distro: ${{ matrix.distro }} run: | - image="coffeateam/coffea-${image_dir}-${distro}" + image="coffeateam/${image_dir}-${distro}" - if [ ${image_dir} == 'basev0' ]; then + if [ ${image_dir} == 'coffea-basev0' ]; then tag="${image}:${releasev0}-py${python}" + release_image=${releasev0} else tag="${image}:${release}-py${python}" + release_image=${release} fi tags=${image}:latest-py${python},$tag echo "::set-output name=tag::${tag}" echo "::set-output name=tags::${tags}" + echo "::set-output name=release:_image:${release}" - name: Build uses: docker/build-push-action@v5 with: load: true tags: ${{ steps.tags.outputs.tag }} - context: ${{ matrix.image_dir }}/${{ matrix.distro }} - file: ${{ matrix.image_dir }}/${{ matrix.distro }}/Dockerfile + context: ${{ matrix.image_dir }} + file: ${{ matrix.image_dir }}/${{ matrix.distro }}Dockerfile.${{ matrix.distro }} build-args: | python=${{ matrix.python }} - release=${{ env.release }} + release=${{ steps.tags.outputs.release_image }} - name: Test Conda environement env: @@ -117,11 +120,11 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - context: ${{ matrix.image_dir }} - file: ${{ matrix.image_dir }}/Dockerfile platforms: linux/amd64 push: ${{ github.event_name == 'push' }} - tags: ${{ steps.tags.outputs.tags }} + tags: ${{ steps.tags.outputs.tag }} + context: ${{ matrix.image_dir }} + file: ${{ matrix.image_dir }}/${{ matrix.distro }}Dockerfile.${{ matrix.distro }} build-args: | python=${{ matrix.python }} - release=${{ env.release }} + release=${{ steps.tags.outputs.release_image }} diff --git a/.github/workflows/watch-conda.yaml b/.github/workflows/watch-conda.yaml index e36b632..40b8d50 100644 --- a/.github/workflows/watch-conda.yaml +++ b/.github/workflows/watch-conda.yaml @@ -11,7 +11,8 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Get current Coffea version + + - name: Get current Coffea version, both v0 and Calver id: current_version uses: the-coding-turtle/ga-yaml-parser@v0.1.2 with: