gitlab-ci integration (#140)

This commit is contained in:
Adam Becker 2018-09-09 15:37:49 -06:00 committed by Ethan Lee
parent 0560581774
commit 3672e94be5
6 changed files with 111 additions and 0 deletions

58
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,58 @@
stages:
- build
- package
- deploy
build_net461:
image: mono
stage: build
only:
- schedules
script:
- ./gitlab-ci/build-net461.sh
artifacts:
paths:
- bin/
tags:
- docker
build_netcore:
image: microsoft/dotnet:2.1-sdk
stage: build
only:
- schedules
script:
- ./gitlab-ci/build-netcore.sh
artifacts:
paths:
- bin/
tags:
- docker
package_nuget:
image: mono
stage: package
only:
- schedules
script:
- ./gitlab-ci/package.sh
dependencies:
- build_net461
- build_netcore
artifacts:
paths:
- '*.nupkg'
deploy_nuget:
image: mono
stage: deploy
only:
- schedules
script:
- ./gitlab-ci/deploy.sh
dependencies:
- package_nuget
environment:
name: nuget
url: http://nuget.org/

23
gitlab-ci/SDL2-CS.nuspec Normal file
View file

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>SDL2-CS-Rolling</id>
<version>%version%</version>
<authors>flibitijibibo</authors>
<owners>beannaich</owners>
<licenseUrl>https://github.com/flibitijibibo/SDL2-CS/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/flibitijibibo/SDL2-CS</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>SDL2# - C# Wrapper for SDL2</description>
<copyright>Copyright 2013-2018</copyright>
<tags>SDL2# SDL2 SDL</tags>
</metadata>
<files>
<file src="..\bin\Debug\*.dll" target="lib/net461" />
<file src="..\bin\Debug\*.dll.config" target="lib/net461" />
<file src="..\bin\Debug\*.pdb" target="lib/net461" />
<file src="..\bin\Debug\netstandard2.0\*.dll" target="lib/netstandard2.0" />
<file src="..\bin\Debug\netstandard2.0\*.dll.config" target="lib/netstandard2.0" />
<file src="..\bin\Debug\netstandard2.0\*.pdb" target="lib/netstandard2.0" />
</files>
</package>

4
gitlab-ci/build-net461.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
msbuild /p:Configuration=Debug SDL2-CS.csproj

4
gitlab-ci/build-netcore.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
dotnet build SDL2-CS.Core.csproj

10
gitlab-ci/deploy.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
set -e
nuget setApiKey $NUGET_API_KEY -verbosity quiet
for package in `find *.nupkg`; do
nuget push $package -source https://nuget.org/
done

12
gitlab-ci/package.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
set -e
version=`date +"%Y.%m.%d"`
nuspec="gitlab-ci/SDL2-CS.nuspec"
sed -i -e "s/%version%/$version/g" $nuspec
nuget pack $nuspec