From 1144424effc02d4d1eaf5e3fb552e0c3a08e3112 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:31:06 +0200 Subject: [PATCH] Trigger docker publish on latest master push as well --- .drone.jsonnet | 17 ++++++++--------- .drone.yml | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 78dcb1e..5ce5db1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -51,7 +51,7 @@ local Build(go, alpine, os, arch) = { ] }; -local Publish(go, alpine, os, arch, platforms) = { +local Publish(go, alpine, os, arch, trigger, platforms, extra) = { kind: "pipeline", type: "docker", name: "publish-" + go + "-alpine" + alpine, @@ -59,10 +59,7 @@ local Publish(go, alpine, os, arch, platforms) = { os: os, arch: arch, }, - trigger: { - event: ["promote"], - target: ["production"], - }, + trigger: trigger, steps: [ { name: "docker", @@ -79,7 +76,6 @@ local Publish(go, alpine, os, arch, platforms) = { from_builder: "golang:" + go +"-alpine" + alpine, from: "alpine:" + alpine, }, - auto_tag: true, auto_tag_suffix: "alpine" + alpine, username: { from_secret: "git_username", @@ -87,7 +83,7 @@ local Publish(go, alpine, os, arch, platforms) = { password: { from_secret: "git_password", }, - } + } + extra, }, ] }; @@ -100,6 +96,9 @@ local Publish(go, alpine, os, arch, platforms) = { Build("1.24", "3.21", "linux", "amd64"), Build("1.24", "3.21", "linux", "arm64"), - Publish("1.24", "3.21", "linux", "amd64", ["linux/amd64", "linux/arm64"]), - Publish("1.22", "3.20", "linux", "amd64", ["linux/amd64", "linux/arm64"]), + # latest + Publish("1.24", "3.21", "linux", "amd64", {event: ["push"], branch: ["master"], }, ["linux/amd64", "linux/arm64"], {tags: ["latest"],}) + {name: "publish-latest"}, + Publish("1.24", "3.21", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, ["linux/amd64", "linux/arm64"], {auto_tag: true,}), + # legacy + Publish("1.22", "3.20", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, ["linux/amd64", "linux/arm64"], {auto_tag: true,}), ] \ No newline at end of file diff --git a/.drone.yml b/.drone.yml index d20e940..e42b3f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -160,6 +160,41 @@ steps: type: docker --- kind: pipeline +name: publish-latest +platform: + arch: amd64 + os: linux +steps: +- image: plugins/buildx + name: docker + privileged: true + settings: + auto_tag_suffix: alpine3.21 + build_args: + from: alpine:3.21 + from_builder: golang:1.24-alpine3.21 + builder_driver: docker-container + compress: true + password: + from_secret: git_password + platform: + - linux/amd64 + - linux/arm64 + registry: git.gammaspectra.live + repo: git.gammaspectra.live/git/go-away + squash: true + tags: + - latest + username: + from_secret: git_username +trigger: + branch: + - master + event: + - push +type: docker +--- +kind: pipeline name: publish-1.24-alpine3.21 platform: arch: amd64 @@ -189,6 +224,7 @@ steps: trigger: event: - promote + - tag target: - production type: docker @@ -223,11 +259,12 @@ steps: trigger: event: - promote + - tag target: - production type: docker --- kind: signature -hmac: b24b30bb7ac591a385173daeb0edbcd9119918ee9e38be90d232f83b8b767115 +hmac: ce284b67eca8ab7014d65a72c617d6ed4d50bdfe4b0103ea47a07ef9d3ee0c68 ...