Skip to content

Commit 1840d1e

Browse files
juancarlostongmikeproeng37
authored andcommitted
ci(codesign): upload build artifacts to s3 (#127)
1 parent a2e9c8b commit 1840d1e

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

.travis.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: csharp
2+
dist: xenial
23
mono:
34
- 5.2.0
45
# needed to make travis run the unit tests
@@ -9,8 +10,14 @@ install:
910
- nuget install ./OptimizelySDK.Tests/packages.config -OutputDirectory ./packages
1011
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory ./testrunner
1112
script:
12-
- xbuild /p:Configuration=Release ./OptimizelySDK.Travis.sln
13-
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll
13+
- xbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$TRAVIS_BUILD_DIR/keypair.snk /p:Configuration=Release ./OptimizelySDK.Travis.sln
14+
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll
15+
# strongname signing from xbuild step needs additional re-signing with sn
16+
- find . -path './OptimizelySDK*bin/Release/OptimizelySDK*.dll' -not -regex '.*Tests.*' -print0 | while IFS= read -r -d '' file; do sn -R $file ./keypair.snk; done
17+
after_success:
18+
- pip install --user awscli
19+
# upload dll build artifacts to s3 with -unsigned suffix
20+
- ([ ${TRAVIS_BRANCH} = "master" ] && [ ${TRAVIS_EVENT_TYPE} = "push" ]) && find . -path './OptimizelySDK*bin/Release/OptimizelySDK*.dll' -not -regex '.*Tests.*' -print0 | while IFS= read -r -d '' file; do (AWS_ACCESS_KEY_ID=$OFTA_KEY AWS_SECRET_ACCESS_KEY=$OFTA_SECRET AWS_DEFAULT_REGION=$OFTA_REGION aws s3 cp $file s3://optly-fs-travisci-artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/$(basename $file)-unsigned); done
1421

1522
# Integration tests need to run first to reset the PR build status to pending
1623
stages:
@@ -20,7 +27,6 @@ stages:
2027
jobs:
2128
include:
2229
- stage: 'Integration tests'
23-
merge_mode: replace
2430
env: SDK=csharp
2531
cache: false
2632
language: python
@@ -32,3 +38,19 @@ jobs:
3238
script:
3339
- "ci/trigger_fullstack-sdk-compat.sh"
3440
after_success: travis_terminate 0
41+
- stage: 'NetStandard16'
42+
language: csharp
43+
# dotnet only works on trusty https://github.com/travis-ci/travis-ci/issues/5189
44+
dist: trusty
45+
mono: none
46+
dotnet: 2.1.502
47+
install:
48+
- dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj
49+
script:
50+
# strongname signing is taken care of in build step
51+
- dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$TRAVIS_BUILD_DIR/keypair.snk
52+
# TODO: no dotnet test yet for NetStandard16
53+
after_success:
54+
- pip install --user awscli
55+
# upload dll build artifacts to s3 with -unsigned suffix
56+
- ([ ${TRAVIS_BRANCH} = "master" ] && [ ${TRAVIS_EVENT_TYPE} = "push" ]) && (AWS_ACCESS_KEY_ID=$OFTA_KEY AWS_SECRET_ACCESS_KEY=$OFTA_SECRET AWS_DEFAULT_REGION=$OFTA_REGION aws s3 cp ./OptimizelySDK.NetStandard16/bin/Debug/netstandard1.6/OptimizelySDK.NetStandard16.dll s3://optly-fs-travisci-artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/OptimizelySDK.NetStandard16.dll-unsigned)

OptimizelySDK.Travis.sln

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
README.md = README.md
1414
EndProjectSection
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OptimizelySDK.Net35", "OptimizelySDK.Net35\OptimizelySDK.Net35.csproj", "{C8FF7012-37B7-4D64-AB45-0C62195302EC}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OptimizelySDK.Net40", "OptimizelySDK.Net40\OptimizelySDK.Net40.csproj", "{41AFD990-BC81-49E3-BD85-40972BB2C262}"
19+
EndProject
1620
Global
1721
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1822
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +31,14 @@ Global
2731
{4DDE7FAA-110D-441C-AB3B-3F31B593E8BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
2832
{4DDE7FAA-110D-441C-AB3B-3F31B593E8BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
2933
{4DDE7FAA-110D-441C-AB3B-3F31B593E8BF}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{C8FF7012-37B7-4D64-AB45-0C62195302EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{C8FF7012-37B7-4D64-AB45-0C62195302EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{C8FF7012-37B7-4D64-AB45-0C62195302EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{C8FF7012-37B7-4D64-AB45-0C62195302EC}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{41AFD990-BC81-49E3-BD85-40972BB2C262}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{41AFD990-BC81-49E3-BD85-40972BB2C262}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{41AFD990-BC81-49E3-BD85-40972BB2C262}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{41AFD990-BC81-49E3-BD85-40972BB2C262}.Release|Any CPU.Build.0 = Release|Any CPU
3042
EndGlobalSection
3143
GlobalSection(SolutionProperties) = preSolution
3244
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)