From bc957ffa37c084568b1f5e582257927aa74affaa Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Thu, 16 Nov 2023 19:22:21 +0800 Subject: [PATCH] update template --- .drone.yml | 11 +++++------ drone/build.yaml | 15 +++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.drone.yml b/.drone.yml index ad0aef1..f16e5e6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,8 @@ kind: template load: build.yaml data: - image_name: x64 - build: - - arch: x64-Debug - type: Debug - - arch: x64-Release - type: Release + builds: + - image_name: linux-x64 + build_types: + - Debug + - Release diff --git a/drone/build.yaml b/drone/build.yaml index ca3d7be..46da587 100644 --- a/drone/build.yaml +++ b/drone/build.yaml @@ -2,10 +2,13 @@ kind: pipeline type: docker name: default steps: - - name: build {{ .input.image_name }} - image: dockcross/{{ .input.image_name }} + {{ range .input.builds }} + {{ $image_name := .image_name }} + - name: build {{ .image_name }} + image: dockcross/{{ .image_name }} commands: - {{ range .input.build }} - - cmake . -Bbuild-{{.arch}} -DCMAKE_BUILD_TYPE={{.type}} - - cmake --build build-{.arch} --config={{.type}} -- -j`nproc` - {{ end }} \ No newline at end of file + {{ range .build_types }} + - cmake . -Bbuild-{{$image_name}}-{{.}} -DCMAKE_BUILD_TYPE={{.}} + - cmake --build build-{{$image_name}}-{{.}} --config={{.}} -- -j`nproc` + {{end}} + {{ end }} \ No newline at end of file