@@ -23,13 +23,37 @@ jobs:
23
23
packages : " anaconda-client skopeo"
24
24
- tag : update
25
25
packages : " git openssh"
26
- runs-on : ubuntu-22.04
26
+ runs-on : ubuntu-24.04
27
+ container :
28
+ # travier/podman-action contains newer podman/buildah versions.
29
+ image : quay.io/travier/podman-action
30
+ options : --privileged
27
31
env :
28
32
IMAGE_NAME : bot
29
- IMAGE_VERSION : ' 1.3.1 '
33
+ IMAGE_VERSION : ' 1.4.0 '
30
34
31
35
steps :
32
- - uses : actions/checkout@v2
36
+ - uses : actions/checkout@v4
37
+
38
+ - name : Install Tools
39
+ run : |
40
+ set -eu
41
+ # jq is not installed in travier/podman-action
42
+ dnf install -qy \
43
+ jq
44
+ rpm -q \
45
+ buildah podman \
46
+ coreutils findutils sed \
47
+ curl jq \
48
+ | (
49
+ while read -r line ; do
50
+ printf %s\\n "${line}"
51
+ case "${line}" in (*' not installed'*)
52
+ err=1 ;;
53
+ esac
54
+ done
55
+ exit "${err-0}"
56
+ )
33
57
34
58
- name : Build
35
59
id : buildah-build
@@ -63,35 +87,35 @@ jobs:
63
87
done
64
88
buildah rmi --prune || true
65
89
66
- # - name: Check Tags
67
- # run: |
68
- # # FIX upstream: Quay.io does not support immutable images currently.
69
- # # => Try to use the REST API to check for duplicate tags.
70
- # respone="$(
71
- # curl -sL \
72
- # 'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image '
73
- # )"
90
+ - name : Check Tags
91
+ run : |
92
+ # FIX upstream: Quay.io does not support immutable images currently.
93
+ # => Try to use the REST API to check for duplicate tags.
94
+ respone="$(
95
+ curl -sL \
96
+ 'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/tag/ '
97
+ )"
74
98
75
- # existing_tags="$(
76
- # printf %s "${respone}" \
77
- # | jq -r '.images[]. tags[]'
78
- # )" \
79
- # || {
80
- # printf %s\\n \
81
- # 'Could not get list of image tags.' \
82
- # 'Does the repository exist on Quay.io?' \
83
- # 'Quay.io REST API response was:' \
84
- # "${respone}"
85
- # exit 1
86
- # }
87
- # for tag in ${{ steps.buildah-build.outputs.tags }} ; do
88
- # if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then
89
- # if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then
90
- # printf 'Tag %s already exists!\n' "${tag}"
91
- # exit 1
92
- # fi
93
- # fi
94
- # done
99
+ existing_tags="$(
100
+ printf %s "${respone}" \
101
+ | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name '
102
+ )" \
103
+ || {
104
+ printf %s\\n \
105
+ 'Could not get list of image tags.' \
106
+ 'Does the repository exist on Quay.io?' \
107
+ 'Quay.io REST API response was:' \
108
+ "${respone}"
109
+ exit 1
110
+ }
111
+ for tag in ${{ steps.buildah-build.outputs.tags }} ; do
112
+ if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then
113
+ if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then
114
+ printf 'Tag %s already exists!\n' "${tag}"
115
+ exit 1
116
+ fi
117
+ fi
118
+ done
95
119
96
120
- if : ${{ github.ref == 'refs/heads/main' }}
97
121
name : Push
0 commit comments