Skip to content

Commit 2dd6f3a

Browse files
galvesribeiroattilah
authored andcommitted
Added CircleCI config (#2)
1 parent 2a051b6 commit 2dd6f3a

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: microsoft/dotnet
6+
steps:
7+
- checkout
8+
- run:
9+
name: restore
10+
command: dotnet restore
11+
- run:
12+
name: build
13+
command: dotnet build -c Release
14+
- deploy:
15+
name: Publish NuGet
16+
command: |
17+
if [ "$CIRCLE_BRANCH" != "release" ]; then
18+
echo -e "\e[33m Branch does not publish -- exit!"
19+
exit
20+
fi
21+
. ./.circleci/utils.sh
22+
if [ "$NUGET_API_KEY" == "" ]; then
23+
echo NUGET_API_KEY environment variable not defined.
24+
exit 1
25+
fi
26+
PACKAGE_VERSION=0.1.$CIRCLE_BUILD_NUM
27+
dotnet pack /p:PackageVersion=$PACKAGE_VERSION -o ../../ -c release --include-symbols
28+
dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://www.nuget.org/api/v2/package
29+
print_title "git tag"
30+
git tag $PACKAGE_VERSION
31+
git push --tags

.circleci/utils.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
print_title() {
3+
echo -e "\e[36m ---- $1 ---- \e[39m"
4+
}

0 commit comments

Comments
 (0)