From 08f37e8592f3473fd1ee8a37fdaf886d418547f7 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Sat, 10 Apr 2021 14:15:03 +0100 Subject: [PATCH] Add CI/CD config --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5bbcad4 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +stages: + - build + - deploy + +build-gpx-anomalies: + stage: build + image: golang:1.15-buster + before_script: + - apt-get -qq update && apt-get --yes install zip + script: + - env GOOS=windows go build -o gpx-anomalies ./cmd/gpx-anomalies + - zip gpx-anomalies.zip gpx-anomalies + artifacts: + paths: + - gpx-anomalies.zip + +publish-gpx-anomalies: + stage: deploy + image: curlimages/curl:latest + variables: + GIT_STRATEGY: none + script: + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file gpx-anomalies.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gpx-anomalies/latest/gpx-anomalies.zip"' + rules: + - if: '$CI_COMMIT_BRANCH == "master"'