Skip to content

Commit e64b260

Browse files
authored
Create and update release draft on master branch builds (#95)
- Add a note to direct users to blockcore-node - Make sure that anyone looking into Blockcore that the best starting point is our blockcore-node repository. - Update build actions - Skip integration tests for PR and MASTER builds. - Schedule a nightly integration test build. - Remove an invalid test SDK assembly from the core project. - Add script to get version. - Add package.json with repo information. - Add icon and other information to the NuGet packages. - Drop the Restore and Build steps, don't need those. - Use folder for release action - Improvement for description on NuGet package.
1 parent da12fd3 commit e64b260

11 files changed

Lines changed: 161 additions & 64 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Build
22

33
on:
44
push:
5-
pull_request:
5+
branches:
6+
- master
67

78
jobs:
89

@@ -22,17 +23,36 @@ jobs:
2223
steps:
2324

2425
- uses: actions/checkout@v1
26+
name: Checkout
2527

28+
- name: Setup Node.js (12.x)
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: 12.x
32+
33+
- name: Variables
34+
run: |
35+
echo "::set-env name=VERSION::$(npm run version --silent)"
36+
2637
- name: Setup .NET Core
2738
uses: actions/setup-dotnet@v1
2839
with:
2940
dotnet-version: '3.1.101'
30-
31-
- name: Restore
32-
run: dotnet restore ${{env.SOLUTION_PATH}}
33-
34-
- name: Build
35-
run: dotnet build --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
36-
41+
3742
- name: Unit Test
3843
run: dotnet test -v=normal --no-build --filter FullyQualifiedName!~IntegrationTests --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
44+
45+
- name: Nuget Pack
46+
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} --output "${{github.workspace}}/package/" ${{env.SOLUTION_PATH}}
47+
48+
- name: Release
49+
if: matrix.os == 'ubuntu-latest'
50+
uses: sondreb/action-release@master
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
folder: "${{github.workspace}}/package/"
54+
draft: true
55+
prerelease: true
56+
body: ''
57+
name: "Blockcore ${{env.VERSION}}"
58+
tag: ${{env.VERSION}}

.github/workflows/publish-pre-release.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Pre-Release Packages
33
on:
44
push:
55
branches:
6-
- master
6+
- custom
77

88
jobs:
99

@@ -19,38 +19,40 @@ jobs:
1919
steps:
2020

2121
- uses: actions/checkout@v1
22-
23-
- name: Setup .NET Core
24-
uses: actions/setup-dotnet@v1
25-
26-
- name: Generate build number
27-
uses: zyborg/gh-action-buildnum@v1.1.0
28-
with:
29-
gist_token: ${{ secrets.GIST_TOKEN }}
30-
set_env: true
22+
23+
# TEMPORARY DISABLED - Do we want to continue with this?
24+
25+
# - name: Setup .NET Core
26+
# uses: actions/setup-dotnet@v1
27+
28+
# - name: Generate build number
29+
# uses: zyborg/gh-action-buildnum@v1.1.0
30+
# with:
31+
# gist_token: ${{ secrets.GIST_TOKEN }}
32+
# set_env: true
3133

32-
- name: Setup NuGet.exe
33-
uses: NuGet/setup-nuget@v1.0.2
34+
# - name: Setup NuGet.exe
35+
# uses: NuGet/setup-nuget@v1.0.2
3436

35-
- name: Set GITHUB_OWNER
36-
run: echo "::set-env name=GITHUB_OWNER::$(echo ${{github.repository}} | cut -d "/" -f 1)"
37+
# - name: Set GITHUB_OWNER
38+
# run: echo "::set-env name=GITHUB_OWNER::$(echo ${{github.repository}} | cut -d "/" -f 1)"
3739

38-
- name: Override bash shell PATH (workaround issue - tinyurl.com/w3dbtou)
39-
run: echo "::add-path::C:\Program Files\Git\bin"
40+
# - name: Override bash shell PATH (workaround issue - tinyurl.com/w3dbtou)
41+
# run: echo "::add-path::C:\Program Files\Git\bin"
4042

41-
- name: Update Directory.Build.props for Push
42-
run: |
43-
find . -name 'Directory.Build.props' -print0 | while read -d $'\0' file
44-
do
45-
sed -i 's,</IsPackable>,</IsPackable>\n\t<RepositoryType>git</RepositoryType>\n\t<RepositoryUrl>git://github.com/${{github.repository}}</RepositoryUrl>,g' $file
46-
done
47-
shell: bash
43+
# - name: Update Directory.Build.props for Push
44+
# run: |
45+
# find . -name 'Directory.Build.props' -print0 | while read -d $'\0' file
46+
# do
47+
# sed -i 's,</IsPackable>,</IsPackable>\n\t<RepositoryType>git</RepositoryType>\n\t<RepositoryUrl>git://github.com/${{github.repository}}</RepositoryUrl>,g' $file
48+
# done
49+
# shell: bash
4850

49-
- name: Nuget Pack
50-
run: dotnet pack --include-source --include-symbols --version-suffix "${{env.NUGET_RELEASE_TYPE}}.${{env.BUILDNUM_FOR_WORKFLOW}}" --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH }}
51+
# - name: Nuget Pack
52+
# run: dotnet pack --include-source --include-symbols --version-suffix "${{env.NUGET_RELEASE_TYPE}}.${{env.BUILDNUM_FOR_WORKFLOW}}" --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH }}
5153

52-
- name: Nuget Add Source
53-
run: nuget sources add -name "GPR" -Source "https://nuget.pkg.github.com/${{env.GITHUB_OWNER}}/index.json" -Username "${{env.GITHUB_OWNER}}" -Password ${{secrets.GITHUB_TOKEN}}
54+
# - name: Nuget Add Source
55+
# run: nuget sources add -name "GPR" -Source "https://nuget.pkg.github.com/${{env.GITHUB_OWNER}}/index.json" -Username "${{env.GITHUB_OWNER}}" -Password ${{secrets.GITHUB_TOKEN}}
5456

55-
- name: Nuget Push
56-
run: nuget push **/*.nupkg -Source "GPR" -SkipDuplicate
57+
# - name: Nuget Push
58+
# run: nuget push **/*.nupkg -Source "GPR" -SkipDuplicate

.github/workflows/publish-release.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,36 @@ jobs:
1313

1414
env:
1515
SOLUTION_PATH: 'src/Blockcore.sln'
16-
BUILD_CONFIGURATION: 'Debug'
16+
BUILD_CONFIGURATION: 'Release'
1717

1818
steps:
1919

2020
- uses: actions/checkout@v1
2121

2222
- name: Setup .NET Core
2323
uses: actions/setup-dotnet@v1
24-
24+
with:
25+
dotnet-version: '3.1.101'
26+
2527
- name: Setup NuGet.exe
2628
uses: NuGet/setup-nuget@v1.0.2
2729

28-
- name: Set GITHUB_OWNER
29-
run: echo "::set-env name=GITHUB_OWNER::$(echo ${{github.repository}} | cut -d "/" -f 1)"
30+
# - name: Set GITHUB_OWNER
31+
# run: echo "::set-env name=GITHUB_OWNER::$(echo ${{github.repository}} | cut -d "/" -f 1)"
3032

31-
- name: Override bash shell PATH (workaround issue - tinyurl.com/w3dbtou)
32-
run: echo "::add-path::C:\Program Files\Git\bin"
33+
# - name: Override bash shell PATH (workaround issue - tinyurl.com/w3dbtou)
34+
# run: echo "::add-path::C:\Program Files\Git\bin"
3335

34-
- name: Update Directory.Build.props for Push
35-
run: |
36-
find . -name 'Directory.Build.props' -print0 | while read -d $'\0' file
37-
do
38-
sed -i 's,</IsPackable>,</IsPackable>\n\t<RepositoryType>git</RepositoryType>\n\t<RepositoryUrl>git://github.com/${{github.repository}}</RepositoryUrl>,g' $file
39-
done
40-
shell: bash
36+
# - name: Update Directory.Build.props for Push
37+
# run: |
38+
# find . -name 'Directory.Build.props' -print0 | while read -d $'\0' file
39+
# do
40+
# sed -i 's,</IsPackable>,</IsPackable>\n\t<RepositoryType>git</RepositoryType>\n\t<RepositoryUrl>git://github.com/${{github.repository}}</RepositoryUrl>,g' $file
41+
# done
42+
# shell: bash
4143

4244
- name: Nuget Pack
43-
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
45+
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} --output "${{github.workspace}}/package" ${{env.SOLUTION_PATH}}
4446

4547
- name: Nuget Push
46-
run: nuget push **/*.nupkg -ApiKey ${{secrets.NUGET_KEY}} -Source "https://api.nuget.org/v3/index.json" -SkipDuplicate -NoSymbols
48+
run: nuget push ${{github.workspace}}/package/*.nupkg -ApiKey ${{secrets.NUGET_KEY}} -Source "https://api.nuget.org/v3/index.json" -SkipDuplicate -NoSymbols

.github/workflows/pull-request.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
10+
buildAndUnitTest:
11+
12+
strategy:
13+
matrix:
14+
os: [ windows-latest, ubuntu-latest, macos-latest ]
15+
fail-fast: false
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
env:
20+
SOLUTION_PATH: 'src/Blockcore.sln'
21+
BUILD_CONFIGURATION: 'Release'
22+
23+
steps:
24+
25+
- uses: actions/checkout@v1
26+
27+
- name: Setup .NET Core
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: '3.1.101'
31+
32+
- name: Restore
33+
run: dotnet restore ${{env.SOLUTION_PATH}}
34+
35+
- name: Build
36+
run: dotnet build -c ${{env.BUILD_CONFIGURATION}} -v m ${{env.SOLUTION_PATH}}
37+
38+
- name: Unit Test
39+
run: dotnet test -v=normal --no-build --filter FullyQualifiedName!~IntegrationTests -c ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Integration Test
1+
name: Test
22

33
on:
4-
push:
5-
pull_request:
4+
schedule:
5+
- cron: '0 3 * * *'
66

77
jobs:
88

@@ -27,12 +27,12 @@ jobs:
2727
uses: actions/setup-dotnet@v1
2828
with:
2929
dotnet-version: '3.1.101'
30-
30+
3131
- name: Restore
3232
run: dotnet restore ${{env.SOLUTION_PATH}}
3333

3434
- name: Build
3535
run: dotnet build --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
3636

3737
- name: Integration Test
38-
run: dotnet test -v=normal --no-build --filter FullyQualifiedName~IntegrationTests --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
38+
run: dotnet test -v=normal --no-build --filter FullyQualifiedName~IntegrationTests --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "blockcore",
3+
"license": "MIT",
4+
"author": {
5+
"name": "Blockcore",
6+
"email": "post@blockcore.net",
7+
"url": "https://www.blockcore.net"
8+
},
9+
"description": "",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/block-core/blockcore.git"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/block-core/blockcore/issues"
16+
},
17+
"homepage": "https://github.com/block-core/blockcore#readme",
18+
"scripts": {
19+
"version": "node version.js",
20+
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
21+
},
22+
"private": true,
23+
"dependencies": {
24+
"conventional-changelog-cli": "2.0.31"
25+
},
26+
"devDependencies": {}
27+
}
28+

src/Blockcore.Features.Miner/Blockcore.Features.Miner.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AssemblyName>Blockcore.Features.Miner</AssemblyName>
77
<PackageId>Blockcore.Features.Miner</PackageId>
88
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
9-
<IsPackable>true</IsPackable>
9+
<IsPackable>true</IsPackable>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

src/Blockcore/Blockcore.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
<PropertyGroup>
44
<AssemblyTitle>Blockcore</AssemblyTitle>
5+
<Description>The Blockcore node software is a full consensus validating node software that runs a blockchain protocol. It is compatible with Bitcoin and utilized by other blockchains at the primary full node.</Description>
56
<AssemblyName>Blockcore</AssemblyName>
67
<PackageId>Blockcore.Core</PackageId>
78
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
89
<CodeAnalysisRuleSet>..\Blockcore.ruleset</CodeAnalysisRuleSet>
910
<IsPackable>true</IsPackable>
1011
</PropertyGroup>
1112

12-
<ItemGroup>
13-
<InternalsVisibleToSuffix Include=".Tests" />
14-
</ItemGroup>
15-
1613
<ItemGroup>
1714
<AdditionalFiles Include="..\stylecop.json" />
1815
</ItemGroup>
@@ -23,7 +20,6 @@
2320
<PackageReference Include="LiteDB" Version="4.1.4" />
2421
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />
2522
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.1" />
26-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
2723
<PackageReference Include="NLog" Version="4.6.8" />
2824
<PackageReference Include="NLog.Extensions.Logging" Version="1.6.1" />
2925
<PackageReference Include="Polly" Version="7.2.0" />
@@ -73,4 +69,4 @@
7369
<NoWarn>1701;1702;1705;IDE0008;</NoWarn>
7470
<DocumentationFile></DocumentationFile>
7571
</PropertyGroup>
76-
</Project>
72+
</Project>

src/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
<Authors>Blockcore</Authors>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>
99
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)None.ruleset</CodeAnalysisRuleset>
10+
<PackageProjectUrl>https://www.blockcore.net</PackageProjectUrl>
11+
<RepositoryType>git</RepositoryType>
12+
<RepositoryUrl>git://github.com/block-core/blockcore</RepositoryUrl>
13+
<PackageIcon></PackageIcon>
14+
<PackageIconUrl>https://www.blockcore.net/assets/icon-64x64.png</PackageIconUrl>
15+
<PackageTags>blockchain;cryptocurrency;crypto;C#;.NET;bitcoin;blockcore</PackageTags>
1016
</PropertyGroup>
1117

1218
<Target Name="AddInternalsVisibleTo" BeforeTargets="CoreCompile">

src/NBitcoin/NBitcoin.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<PackageId>Blockcore.NBitcoin</PackageId>
44
<AssemblyName>Blockcore.NBitcoin</AssemblyName>
5+
<Description>Modified fork of the original NBitcoin, modified to be useable for a full blockchain implementation.</Description>
56
<RootNamespace>NBitcoin</RootNamespace>
67
<IsPackable>true</IsPackable>
78
</PropertyGroup>

0 commit comments

Comments
 (0)