Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vsts ci #22

Merged
merged 31 commits into from
Aug 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9aab9e4
Add YAML CI setup for City Chain
sondreb Aug 10, 2018
d3f9e6e
Remove reference to Apps feature
sondreb Aug 10, 2018
440f80e
Fix for variables
sondreb Aug 10, 2018
a7a7f73
Fix
sondreb Aug 10, 2018
5ab8404
Test
sondreb Aug 10, 2018
7a9a909
Test 2
sondreb Aug 10, 2018
1f0a77c
This should work, or do we need to run a format?
sondreb Aug 10, 2018
5b5037a
Got it!
sondreb Aug 10, 2018
c8e72f5
Got it 2!
sondreb Aug 10, 2018
5000fb7
Working folder does not work properly.
sondreb Aug 10, 2018
f8c8c1a
Define project
sondreb Aug 10, 2018
6bebb37
Test
sondreb Aug 10, 2018
bb18c13
Minor compile fix
sondreb Aug 10, 2018
a45baed
Test
sondreb Aug 10, 2018
ad2bb0c
Add arguments, see if it fails again
sondreb Aug 10, 2018
eb76117
Add package.json to have build release publish read version
sondreb Aug 10, 2018
df04401
Update CI build setup
sondreb Aug 10, 2018
0ce6e7d
Indent
sondreb Aug 10, 2018
7e4e0c0
Test with parameter
sondreb Aug 10, 2018
09e824f
Write variables with PS then use them
sondreb Aug 10, 2018
24cfa25
Use of parameters always require use of format
sondreb Aug 10, 2018
c17735e
Another attempt at syntax fix for joining VSTS variables and YAML par…
sondreb Aug 10, 2018
af02034
Special package for Linux
sondreb Aug 10, 2018
20e1aa1
if or condition, that is the question?
sondreb Aug 10, 2018
4ce4de0
Cleanup of YAML
sondreb Aug 10, 2018
0615c2e
Remove the condition
sondreb Aug 10, 2018
8f8705d
Upgrade version before PR
sondreb Aug 11, 2018
c52b79b
Add condition for PRs
sondreb Aug 11, 2018
6ec2f81
Is condition variable required to be lower-case?
sondreb Aug 11, 2018
d7525c4
Add logging
sondreb Aug 11, 2018
c5cdd29
Add condition based on sourcebranch
sondreb Aug 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
phases:
- template: build.yml
parameters:
name: macOS
platform: osx
queue: Hosted macOS Preview

- template: build.yml
parameters:
name: Linux
platform: linux
queue: Hosted Linux Preview

- template: build.yml
parameters:
name: Windows_x86
platform: win
arch: x86
queue: Hosted VS2017

- template: build.yml
parameters:
name: Windows_x64
platform: win
queue: Hosted VS2017

name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
105 changes: 0 additions & 105 deletions appveyor.yml

This file was deleted.

34 changes: 0 additions & 34 deletions build.sh

This file was deleted.

59 changes: 59 additions & 0 deletions build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
parameters:
name: ''
queue: ''
platform: ''
arch: 'x64' # Only overriden by 32-bit Windows
configuration: 'Release' # Only do debug if specified

phases:
- phase: ${{ parameters.name }}
displayName: ${{ format('City Chain ({0}-{1})', parameters.platform, parameters.arch) }}
queue: ${{ parameters.queue }}
steps:

- powershell: |
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
Write-Host "##vso[task.setvariable variable=Build.BuildNumber]$version"
Write-Host "##vso[task.setvariable variable=App.BuildNumber]$version"
Write-Host "BUILD_REASON: $Env:BUILD_REASON"
Write-Host "BUILD_SOURCEBRANCH: $Env:BUILD_SOURCEBRANCH"
Write-Host "BUILD_SOURCEBRANCHNAME: $Env:BUILD_SOURCEBRANCHNAME"
Write-Host "SYSTEM_PULLREQUEST_PULLREQUESTID: $Env:SYSTEM_PULLREQUEST_PULLREQUESTID"
Write-Host "SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: $Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
Write-Host "SYSTEM_PULLREQUEST_SOURCEBRANCH: $Env:SYSTEM_PULLREQUEST_SOURCEBRANCH"
displayName: version number

- task: DotNetCoreCLI@2
displayName: dotnet publish
inputs:
command: publish
projects: '**/City.Chain.csproj'
workingDirectory: 'src/City.Chain'
publishWebProjects: false
zipAfterPublish: false
modifyOutputPath: false
arguments: ${{ format('-c {0} -r {1}-{2} -v m', parameters.configuration, parameters.platform, parameters.arch) }}

- task: ArchiveFiles@2
displayName: archive
inputs:
rootFolderOrFile: ${{ format('src/City.Chain/bin/{0}/netcoreapp2.1/{1}-{2}/publish/', parameters.configuration, parameters.platform, parameters.arch) }}
includeRootFolder: false

${{ if eq(parameters.platform, 'linux') }}:
archiveFile: ${{ format('$(Build.ArtifactStagingDirectory)/City.Chain-$(App.BuildNumber)-{0}-{1}.tar.gz', parameters.platform, parameters.arch) }}
archiveType: tar
${{ if ne(parameters.platform, 'linux') }}:
archiveFile: ${{ format('$(Build.ArtifactStagingDirectory)/City.Chain-$(App.BuildNumber)-{0}-{1}.zip', parameters.platform, parameters.arch) }}

- task: marcelo-formentao.github-tools.github-release-publish-task.GitHubReleasePublish@0
displayName: github release
condition: and(succeeded(), eq(variables['build.sourcebranch'], 'refs/heads/master'))
inputs:
githubEndpoint: github
githubRepository: 'CityChainFoundation/city-chain'
githubReleaseTitle: 'City Chain $(Build.BuildNumber) (Preview Release)'
githubReleasePrerelease: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/City.Chain*.*'
manifestJson: package.json
githubEditRelease: true
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "citychain",
"version": "0.0.20",
"license": "MIT",
"author": {
"name": "City Chain Foundation",
"email": "citychainmail@gmail.com",
"url": "https://citychain.foundation"
},
"description": "City Chain is the daemon for connecting to City Chain and the Smart City Platform.",
"repository": {
"type": "git",
"url": "git+https://github.com/CityChainFoundation/city-chain.git"
},
"bugs": {
"url": "https://github.com/CityChainFoundation/city-chain/issues"
},
"homepage": "https://github.com/CityChainFoundation/city-chain#readme",
"main": "main.js",
"scripts": {
},
"private": true,
"dependencies": {
},
"devDependencies": {
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion src/City.Chain/City.Chain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<ProjectReference Include="..\City\City.csproj" />
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Apps\Stratis.Bitcoin.Features.Apps.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.BlockStore\Stratis.Bitcoin.Features.BlockStore.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Consensus\Stratis.Bitcoin.Features.Consensus.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.MemoryPool\Stratis.Bitcoin.Features.MemoryPool.csproj" />
Expand Down
9 changes: 4 additions & 5 deletions src/City.Chain/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.Api;
using Stratis.Bitcoin.Features.Apps;
using Stratis.Bitcoin.Features.BlockStore;
using Stratis.Bitcoin.Features.Consensus;
using Stratis.Bitcoin.Features.MemoryPool;
Expand Down Expand Up @@ -98,11 +97,11 @@ public static async Task Main(string[] args)
.UseMempool()
.UseWallet()
.AddPowPosMining()
.UseBlockNotification()
.UseTransactionNotification()
.AddSimpleWallet()
//.UseBlockNotification()
//.UseTransactionNotification()
//.AddSimpleWallet()
.UseApi()
.UseApps()
//.UseApps()
.AddRPC()
.Build();

Expand Down