From b2610be8cc8cadde2548779b790cae19a0dbafb4 Mon Sep 17 00:00:00 2001 From: Oksana Shadura Date: Thu, 17 Oct 2024 14:29:35 +0200 Subject: [PATCH] Fix #35 issue: now we have both tagged (aka stable) and development versions of images --- .github/workflows/autotag.yaml | 18 ++++++++++++ .github/workflows/autotag.yaml_debug | 25 ----------------- .github/workflows/gh-ci.yaml | 41 ++++++++++++++-------------- 3 files changed, 38 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/autotag.yaml delete mode 100644 .github/workflows/autotag.yaml_debug diff --git a/.github/workflows/autotag.yaml b/.github/workflows/autotag.yaml new file mode 100644 index 0000000..37557f5 --- /dev/null +++ b/.github/workflows/autotag.yaml @@ -0,0 +1,18 @@ +name: Create Tag + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: butlerlogic/action-autotag@stable + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + strategy: regex + regex_pattern: '\s*\[?.*release\]?: "?.*(\d{4}\.\d{1,2}\.\d+).*"?' + root: ".github/workflows/gh-ci.yaml" diff --git a/.github/workflows/autotag.yaml_debug b/.github/workflows/autotag.yaml_debug deleted file mode 100644 index c1b2061..0000000 --- a/.github/workflows/autotag.yaml_debug +++ /dev/null @@ -1,25 +0,0 @@ -name: Auto Tag - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: butlerlogic/action-autotag@stable - with: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - strategy: regex - regex_pattern: 'releasev0: \"0.\d+\.\d+\"' - root: ".github/workflows/gh-ci.yml" - - uses: butlerlogic/action-autotag@stable - with: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - strategy: regex - # CalVer version for coffea - regex_pattern: 'release: \"\d{4}\.\d{1,2}\.\d+\"' - root: ".github/workflows/gh-ci.yml" diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 1307698..30ceeb8 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -14,8 +14,8 @@ env: GITHUB_REF: ${{ github.ref }} # Update each time there is added latest python: it will be used for `latest` tag python_latest: "3.11" - release: 2024.9.0 - releasev0: 0.7.22 + release: "2024.9.1" + releasev0: "0.7.22" jobs: @@ -85,32 +85,31 @@ jobs: releasev0: ${{ env.releasev0 }} release: ${{ env.release }} python_latest: ${{ env.python_latest}} + stable: ${{ startsWith(github.ref, 'refs/tags') }} run: | image="coffeateam/${image_dir}-${distro}" image_default="coffeateam/${image_dir}" - if [ ${image_dir} == 'coffea-base' ]; then - tag="${image}:${releasev0}-py${python}" + # release tag or in case other case make it dev + if [ "$stable" == "true" ]; then + if [ ${image_dir} == 'coffea-base' ]; then + tag="${image}:${releasev0}-py${python}" + else + tag="${image}:${release}-py${python}" + fi + tags=${image}:latest-py${python},$tag + # latest tag + if [ ${python} == ${python_latest} ]; then + tags=${image}:latest,$tags + fi else - tag="${image}:${release}-py${python}" + tag="${image}:dev-py${python}" + tags=$tag + if [ "$python" == ${python_latest} ]; then + tags=${image}:dev,$tags + fi fi - ## Default image name for dask-base and dask-dask - #if [ ${distro} == 'alma8' ]; then - # tag_default="${image_default}:${releasev0}-py${python},${image_default}:${release}-py${python}" - #fi - - if [ ${python} == ${python_latest} ]; then - latest=${image}:latest - ## Let's overwrite latest - #if [ ${distro} == 'alma8' ]; then - # latest="${image_default}:latest - #fi - fi - - #tags=$tag,${image}:latest-py${python},$latest,$tag_default - tags=$tag,${image}:latest-py${python},$latest - echo "::set-output name=tag::${tag}" echo "::set-output name=tags::${tags}"