From b512b962a1cc71546d95f7d81763fa0ffe9c6594 Mon Sep 17 00:00:00 2001
From: Lars Seipel <ls@slrz.net>
Date: Mon, 16 Jan 2023 14:07:51 +0100
Subject: [PATCH] build in GitLab CI/CD

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..eecc084
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,15 @@
+build:
+  variables:
+    comm: go-mmproxy
+    os: linux
+  image: docker.io/golang:1.21
+  before_script:
+    - go mod download
+  script:
+    - |
+      for arch in amd64 arm64 ppc64le; 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/go-mmproxy/latest/$comm-$os-$arch" || exit 1
+      done
+  only:
+    - deploy
-- 
GitLab