make-targets: stage: .pre image: alpine:3.11 script: - apk add curl jq - curl https://api.github.com/repos/ocaml/ocaml/releases | jq -r 'map(.tag_name | split(".") | {"maj":.[0:2], "pat":.}) | group_by(.maj) | .[] | max | .pat | join(".")' | tail -n +3 > versions - | { for v in $(cat versions); do echo "ocaml-image-$v:"; echo " extends: .ocaml-image"; echo " variables:"; echo " OCAML_VERSION: $v"; echo; done; echo "variables:" echo " LATEST_OCAML_VERSION: $(tail -n1 versions)"; } > ocaml-images.yml artifacts: paths: - ocaml-images.yml build-images: stage: build trigger: include: - local: ocaml-images-gen.yml - artifact: ocaml-images.yml job: make-targets strategy: depend only: - master