2021-01-02 22:23:58 +00:00
|
|
|
local pipeline(os, arch) = {
|
2021-01-02 22:22:07 +00:00
|
|
|
kind: "pipeline",
|
2021-01-02 22:23:58 +00:00
|
|
|
name: "build " + os + "/" + arch,
|
2021-01-02 22:01:44 +00:00
|
|
|
steps: [{
|
2021-01-02 22:20:26 +00:00
|
|
|
name: "compile " + os + "/" + arch,
|
2021-01-02 22:01:44 +00:00
|
|
|
image: "golang:1.15.6-alpine3.12",
|
|
|
|
environment: {
|
|
|
|
"GOOS": os,
|
|
|
|
"GOARCH": arch,
|
|
|
|
"CGO_ENABLED": "0",
|
|
|
|
},
|
|
|
|
commands: [
|
2021-01-02 22:20:26 +00:00
|
|
|
'go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -trimpath -o release/' + os + "/" + arch + "/ubnt-freifunk-map-api .",
|
2021-01-02 22:36:27 +00:00
|
|
|
"tar -cvzf release/ubnt-freifunk-map-api_"+ os + "-" + arch + ".tar.gz -C release/" + os + "/" + arch + " ubnt-freifunk-map-api"
|
2021-01-02 22:01:44 +00:00
|
|
|
],
|
|
|
|
},
|
2021-01-02 22:42:19 +00:00
|
|
|
{
|
|
|
|
name: "gitea_release " + os + "/" + arch,
|
|
|
|
image: "plugins/gitea-release",
|
|
|
|
settings: {
|
2021-01-02 23:22:14 +00:00
|
|
|
api_key: { "from_secret": "gitea_api_key" },
|
2021-01-02 22:42:19 +00:00
|
|
|
base_url: "https://git.freifunk-rhein-sieg.net",
|
|
|
|
files: "release/*.tar.gz"
|
|
|
|
},
|
|
|
|
when: {
|
|
|
|
event: "tag"
|
|
|
|
},
|
|
|
|
},
|
2021-01-02 23:39:50 +00:00
|
|
|
{
|
|
|
|
name: "upload to docker hub " + os + "/" + arch,
|
2021-01-03 00:28:54 +00:00
|
|
|
image: "plugins/docker:" + os + "-" + arch,
|
2021-01-02 23:39:50 +00:00
|
|
|
settings: {
|
|
|
|
repo: "fftdf/ffmap-ubnt-api",
|
|
|
|
username: { "from_secret": "docker_username" },
|
|
|
|
password: { "from_secret": "docker_password" },
|
|
|
|
auto_tag: true,
|
|
|
|
auto_tag_suffix: os + "-" + arch
|
|
|
|
},
|
|
|
|
when: {
|
|
|
|
event: "tag"
|
|
|
|
},
|
|
|
|
},
|
2021-01-02 22:01:44 +00:00
|
|
|
],
|
|
|
|
};
|
2021-01-02 23:19:39 +00:00
|
|
|
|
2021-01-02 22:01:44 +00:00
|
|
|
[
|
|
|
|
pipeline("linux", "amd64"),
|
2021-01-03 11:38:46 +00:00
|
|
|
// pipeline("linux", "arm64"),
|
2021-01-03 10:58:20 +00:00
|
|
|
// pipeline("darwin", "amd64"),
|
2021-01-02 22:42:19 +00:00
|
|
|
// pipeline("darwin", "arm64"),
|
2021-01-03 11:38:46 +00:00
|
|
|
// pipeline("windows", "amd64"),
|
2021-01-02 22:16:14 +00:00
|
|
|
]
|