Skip to content

Commit

Permalink
Separated build & deploy scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Farkas committed Sep 21, 2017
1 parent 3e744ad commit c150332
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@ mono: none

env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=: true
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1

script:
- dotnet restore
- dotnet build -c Release
- cd ./Nexogen.Libraries.Metrics.UnitTests && dotnet test && cd ..
- dotnet pack ./Nexogen.Libraries.Metrics -c Release --version-suffix $TRAVIS_BUILD_NUMBER
- dotnet pack ./Nexogen.Libraries.Metrics.Extensions -c Release --version-suffix $TRAVIS_BUILD_NUMBER
- dotnet pack ./Nexogen.Libraries.Metrics.Prometheus -c Release --version-suffix $TRAVIS_BUILD_NUMBER
- dotnet pack ./Nexogen.Libraries.Metrics.Prometheus.AspCore -c Release --version-suffix $TRAVIS_BUILD_NUMBER
- dotnet pack ./Nexogen.Libraries.Metrics.Prometheus.PushGateway -c Release --version-suffix $TRAVIS_BUILD_NUMBER
- chmod +x ./build.sh && ./build.sh

# deploy:
# provider: script
# script: dotnet nuget push **/*.nupkg -s https://nuget.org -k $NUGET_API_KEY
# on:
# branch: master
deploy:
skip_cleanup: true
provider: script
script: chmod +x ./deploy.sh && ./deploy.sh $NUGET_API_KEY $TRAVIS_BUILD_NUMBER
on:
branch: master
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

#exit if any command fails
set -e

dotnet restore
dotnet build -c Release
cd ./Nexogen.Libraries.Metrics.UnitTests && dotnet test && cd ..
14 changes: 14 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

#exit if any command fails
set -e

NUGET_API_KEY=$1
NUGET_VERSION_SUFFIX=$2

dotnet pack ./Nexogen.Libraries.Metrics -c Release --version-suffix $NUGET_VERSION_SUFFIX
dotnet pack ./Nexogen.Libraries.Metrics.Extensions -c Release --version-suffix $NUGET_VERSION_SUFFIX
dotnet pack ./Nexogen.Libraries.Metrics.Prometheus -c Release --version-suffix $NUGET_VERSION_SUFFIX
dotnet pack ./Nexogen.Libraries.Metrics.Prometheus.AspCore -c Release --version-suffix $NUGET_VERSION_SUFFIX
dotnet pack ./Nexogen.Libraries.Metrics.Prometheus.PushGateway -c Release --version-suffix $NUGET_VERSION_SUFFIX
dotnet nuget push **/*.nupkg -s https://nuget.org -k $NUGET_API_KEY

0 comments on commit c150332

Please sign in to comment.