From f27d0257f7f529568d0b02b3a48266d967c3707c Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sat, 4 Apr 2020 19:15:03 +0800 Subject: [PATCH] Add GitLabCI Linux pipeline This pipeline doesn't come with Mono out-of-the-box like the GH-Actions one, so then we need to install mono ourselves (and there are 3 different ways to do it). --- .gitlab-ci.yml | 49 +++++++++++++++++++ ...nstall_mono_from_microsoft_deb_packages.sh | 15 ++++++ 2 files changed, 64 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100755 scripts/install_mono_from_microsoft_deb_packages.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9277b50 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +variables: + NUGET_540_URL: https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe + NUGET_451_URL: https://dist.nuget.org/win-x86-commandline/v4.5.1/nuget.exe + +before_script: + - apt update + # needed to download NuGet + - apt install -y curl + +stages: + - build + +stockmono_build: + image: ubuntu:18.04 + stage: build + script: + # https://askubuntu.com/a/1013396 + - DEBIAN_FRONTEND=noninteractive apt install -y mono-complete mono-xbuild fsharp + - mono --version + + - curl -o nuget.exe $NUGET_451_URL + - mono nuget.exe restore src/TgSharp.sln + - xbuild src/TgSharp.Core/TgSharp.Core.csproj + +stocknewmono_build: + image: ubuntu:20.04 + stage: build + script: + # https://askubuntu.com/a/1013396 + - DEBIAN_FRONTEND=noninteractive apt install -y mono-complete mono-xbuild fsharp + - mono --version + + - curl -o nuget.exe $NUGET_540_URL + - mono nuget.exe restore src/TgSharp.sln + - xbuild src/TgSharp.Core/TgSharp.Core.csproj + +newmono_build: + image: ubuntu:18.04 + stage: build + artifacts: + paths: + - bin/*.zip + expire_in: 50days + script: + - ./scripts/install_mono_from_microsoft_deb_packages.sh + + - curl -o nuget.exe $NUGET_540_URL + - mono nuget.exe restore src/TgSharp.sln + - msbuild src/TgSharp.Core/TgSharp.Core.csproj diff --git a/scripts/install_mono_from_microsoft_deb_packages.sh b/scripts/install_mono_from_microsoft_deb_packages.sh new file mode 100755 index 0000000..7b88d93 --- /dev/null +++ b/scripts/install_mono_from_microsoft_deb_packages.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# required by apt-key +apt install -y gnupg2 +# required by apt-update when pulling from mono-project.com +apt install -y ca-certificates + +# taken from http://www.mono-project.com/download/stable/#download-lin +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +# bionic(=18.04) below works even for 18.10, 19.04 and 19.10 +echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list +apt update +apt install -y mono-devel +mono --version