From a4bbe474db92105877ea7f884abb3cc2484d33b7 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder Date: Wed, 23 Apr 2025 07:24:08 +0200 Subject: [PATCH] drone: add codeberg package url --- .drone.jsonnet | 18 +++++++----- .drone.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 11 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 763f170..8544105 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -52,10 +52,10 @@ local Build(go, alpine, os, arch) = { ] }; -local Publish(go, alpine, os, arch, trigger, platforms, extra) = { +local Publish(registry, repo, secret, go, alpine, os, arch, trigger, platforms, extra) = { kind: "pipeline", type: "docker", - name: "publish-" + go + "-alpine" + alpine, + name: "publish-" + go + "-alpine" + alpine + "-" + secret, platform: { os: os, arch: arch, @@ -70,8 +70,8 @@ local Publish(go, alpine, os, arch, trigger, platforms, extra) = { DOCKER_BUILDKIT: "1" }, settings: { - registry: "git.gammaspectra.live", - repo: "git.gammaspectra.live/git/go-away", + registry: registry, + repo: repo, compress: true, platform: platforms, builder_driver: "docker-container", @@ -81,10 +81,10 @@ local Publish(go, alpine, os, arch, trigger, platforms, extra) = { }, auto_tag_suffix: "alpine" + alpine, username: { - from_secret: "git_username", + from_secret: secret + "_username", }, password: { - from_secret: "git_password", + from_secret: secret + "_password", }, } + extra, }, @@ -99,8 +99,10 @@ local containerArchitectures = ["linux/amd64", "linux/arm64", "linux/riscv64"]; Build("1.24", "3.21", "linux", "arm64"), # latest - Publish("1.24", "3.21", "linux", "amd64", {event: ["push"], branch: ["master"], }, containerArchitectures, {tags: ["latest"],}) + {name: "publish-latest"}, + Publish("git.gammaspectra.live", "git.gammaspectra.live/git/go-away", "git", "1.24", "3.21", "linux", "amd64", {event: ["push"], branch: ["master"], }, containerArchitectures, {tags: ["latest"],}) + {name: "publish-latest-git"}, + Publish("codeberg.org", "codeberg.org/weebdatahoarder/go-away", "codeberg", "1.24", "3.21", "linux", "amd64", {event: ["push"], branch: ["master"], }, containerArchitectures, {tags: ["latest"],}) + {name: "publish-latest-codeberg"}, # modern - Publish("1.24", "3.21", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, containerArchitectures, {auto_tag: true,}), + Publish("git.gammaspectra.live", "git.gammaspectra.live/git/go-away", "git", "1.24", "3.21", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, containerArchitectures, {auto_tag: true,}), + Publish("codeberg.org", "codeberg.org/weebdatahoarder/go-away", "codeberg", "1.24", "3.21", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, containerArchitectures, {auto_tag: true,}), ] \ No newline at end of file diff --git a/.drone.yml b/.drone.yml index 4d7cd3a..12ea62e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -82,7 +82,7 @@ steps: type: docker --- kind: pipeline -name: publish-latest +name: publish-latest-git platform: arch: amd64 os: linux @@ -119,7 +119,44 @@ trigger: type: docker --- kind: pipeline -name: publish-1.24-alpine3.21 +name: publish-latest-codeberg +platform: + arch: amd64 + os: linux +steps: +- environment: + DOCKER_BUILDKIT: "1" + 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: codeberg_password + platform: + - linux/amd64 + - linux/arm64 + - linux/riscv64 + registry: codeberg.org + repo: codeberg.org/weebdatahoarder/go-away + tags: + - latest + username: + from_secret: codeberg_username +trigger: + branch: + - master + event: + - push +type: docker +--- +kind: pipeline +name: publish-1.24-alpine3.21-git platform: arch: amd64 os: linux @@ -155,7 +192,44 @@ trigger: - production type: docker --- +kind: pipeline +name: publish-1.24-alpine3.21-codeberg +platform: + arch: amd64 + os: linux +steps: +- environment: + DOCKER_BUILDKIT: "1" + image: plugins/buildx + name: docker + privileged: true + settings: + auto_tag: true + 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: codeberg_password + platform: + - linux/amd64 + - linux/arm64 + - linux/riscv64 + registry: codeberg.org + repo: codeberg.org/weebdatahoarder/go-away + username: + from_secret: codeberg_username +trigger: + event: + - promote + - tag + target: + - production +type: docker +--- kind: signature -hmac: 1b7c264865c2cf283d10a02ef6a9e19920f0a81010dec37a92300a7e59e57348 +hmac: 6df9c42b8cc689f661dc3612f39f5ffce2dea2f50a92e45355fed1d882ee8c5a ...