ulib/drone/build.yaml
2023-11-17 11:33:34 +08:00

39 lines
1.0 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
{{ $prepare_commands := .input.prepare_commands }}
{{ $before_commands := .input.before_commands }}
{{ $after_commands := .input.after_commands }}
{{ $default_build_types := .input.default_build_types }}
{{ range .input.builds }}
{{ $image_name := .image_name }}
- name: build {{ .image_name }}
image: dockcross/{{ .image_name }}
commands:
{{ range $prepare_commands }}
- {{ . }}
{{ end }}
{{ $build_types := $default_build_types }}
{{ if .build_types }}
{{ $build_types := .build_types }}
{{ end }}
{{ range $build_types }}
- cmake . -Bbuild-{{$image_name}}-{{.}} -DCMAKE_BUILD_TYPE={{.}}
- cmake --build build-{{$image_name}}-{{.}} --config {{.}} -- -j`nproc`
{{end}}
{{ range $after_commands }}
- {{ . }}
{{ end }}
{{ end }}
- name: list all build dir
image: alpine
commands:
- ls -l build-*
depends_on:
{{ range .input.builds }}
- build {{ .image_name }}
{{ end }}