From 3725557bda22ae4dbbc2e7db7eee35797b141305 Mon Sep 17 00:00:00 2001
From: Lars Seipel <ls@slrz.net>
Date: Sat, 28 Oct 2023 20:42:37 +0200
Subject: [PATCH] cicd: build in pipeline

---
 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..1f140bb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,13 @@
+build:
+  variables:
+    os: linux
+    comm: behealthy
+  image: docker.io/golang:1.21
+  before_script:
+    - go mod download
+  script:
+    - |
+      for arch in amd64 arm64; do
+        GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o "$comm-$os-$arch" || exit 1
+        curl -H "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./$comm-$os-$arch "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/behealthy/latest/$comm-$os-$arch" || exit 1
+      done
-- 
GitLab