diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..c15fd3a --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,29 @@ +local pipeline(arch, os) = { + kind: "pipeline", + name: "build " + os + "/" + arch, + platform: { + os: os, + arch: arch, + }, + steps: [{ + image: "golang:1.15.6-alpine3.12", + environment: { + "GOOS": os, + "GOARCH": arch, + "CGO_ENABLED": "0", + }, + commands: [ + 'go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/' + os + "/" + arch + "/ubnt-freifunk-map-api .", + "tar -cvzf release/ubnt-freifunk-map-api_"+ os + "/" + arch + ".tar.gz -C release/" + os + "/" + arch + " ubnt-freifunk-map-api" + ], + }, + ], +}; +[ + pipeline("linux", "amd64"), + pipeline("linux", "arm64"), + pipeline("darwin", "amd64"), + pipeline("darwin", "arm64"), + pipeline("windows", "amd64"), + pipeline("windows", "arm64"), +] \ No newline at end of file diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index da2242e..0000000 --- a/.drone.yml +++ /dev/null @@ -1,52 +0,0 @@ -global-variables: - env: &env - image: golang - commands: - - go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/$GOOS/$GOARCH/ubnt-freifunk-map-api . - - tar -cvzf release/ubnt-freifunk-map-api_$GOOS_$GOARCH.tar.gz -C release/$GOOS/$GOARCH ubnt-freifunk-map-api - -kind: pipeline -type: docker -name: build go - -steps: &steps - - name: build linux/amd64 - <<: *env - environment: - GOARCH: amd64 - GOOS: linux - - - name: build linux/arm64 - <<: *env - environment: - GOARCH: arm64 - GOOS: linux - - - name: build windows - <<: *env - environment: - GOARCH: amd64 - GOOS: windows - - - name: build macos/x64 - <<: *env - environment: - GOARCH: amd64 - GOOS: darwin - - - name: build macos/arm64 - <<: *env - environment: - GOARCH: arm64 - GOOS: darwin - - - name: docker - image: plugins/docker - settings: - repo: fftdf/ffmap-ubnt-api - username: - from_secret: docker_username - password: - from_secret: docker_password - when: - event: tag \ No newline at end of file