Skip to content

Commit 8aefa13

Browse files
authored
Feature/upload artifact on workflow (#293)
* Add upload of artifact to the build - Closes #291 * Update the workflows to download release artefacts and publish * Update build properties to include symbols - Include symbols and set portable snupkg formats. * Add a reference to SourceLink for all projects * Only perform the artifact upload for ubuntu builds * Fix for nuget push * Cleanup before merge
1 parent 2f1b241 commit 8aefa13

7 files changed

Lines changed: 68 additions & 39 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
push:
55
branches:
66
- master
7-
repository_dispatch:
8-
types: [build]
7+
# repository_dispatch:
8+
# types: [build]
99
workflow_dispatch:
1010

1111
jobs:
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727

28-
- uses: actions/checkout@v1
28+
- uses: actions/checkout@v2
2929
name: Checkout
3030

3131
- name: Setup Node.js (12.x)
@@ -44,7 +44,13 @@ jobs:
4444
dotnet test -v=normal --filter "FullyQualifiedName!~IntegrationTests&Unstable!=True" -c ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}}
4545
4646
- name: Nuget Pack
47-
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} --output "${{github.workspace}}/package/" ${{env.SOLUTION_PATH}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
47+
run: dotnet pack --configuration ${{env.BUILD_CONFIGURATION}} --output "${{github.workspace}}/package/" ${{env.SOLUTION_PATH}}
48+
49+
- uses: actions/upload-artifact@v2
50+
if: matrix.os == 'ubuntu-latest'
51+
with:
52+
name: Blockcore-${{env.VERSION}}-preview
53+
path: "${{github.workspace}}/package/"
4854

4955
- uses: actions/upload-artifact@v2
5056
with:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
publishPreReleasePackages:
1111

12-
runs-on: windows-latest
12+
runs-on: ubuntu-latest
1313

1414
env:
1515
SOLUTION_PATH: 'src/Blockcore.sln'
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020

21-
- uses: actions/checkout@v1
21+
- uses: actions/checkout@v2
2222

2323
# TEMPORARY DISABLED - Do we want to continue with this?
2424

.github/workflows/publish-release.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424

25-
- uses: actions/checkout@v1
25+
- uses: actions/checkout@v2
2626

2727
- name: Restore
2828
run: dotnet restore ${{env.SOLUTION_PATH}}

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Release Packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
# repository_dispatch:
7+
# types: [publish-packages]
8+
workflow_dispatch:
9+
10+
jobs:
11+
12+
publishPackages:
13+
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
SOLUTION_PATH: 'src/Blockcore.sln'
18+
BUILD_CONFIGURATION: 'Release'
19+
20+
steps:
21+
22+
- uses: actions/checkout@v2
23+
24+
- name: Log Variables
25+
run: |
26+
echo "action - ${{ github.event.action }}"
27+
echo "url - ${{ github.event.release.url }}"
28+
echo "assets_url - ${{ github.event.release.assets_url }}"
29+
echo "id - ${{ github.event.release.id }}"
30+
echo "tag_name - ${{ github.event.release.tag_name }}"
31+
echo "assets - ${{ github.event.assets }}"
32+
echo "assets[0] - ${{ github.event.assets[0] }}"
33+
34+
- name: Release Download
35+
uses: sondreb/action-release-download@master
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
url: ${{ github.event.release.assets_url }}
39+
folder: "./artifacts/"
40+
41+
- name: Display structure of downloaded files
42+
run: ls -R
43+
44+
- name: Nuget Push
45+
run: nuget push "${{github.workspace}}/artifacts/*.nupkg" -ApiKey ${{secrets.NUGET_KEY}} -Source "https://api.nuget.org/v3/index.json" -SkipDuplicate

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626

27-
- uses: actions/checkout@v1
27+
- uses: actions/checkout@v2
2828

2929
- name: Restore
3030
run: dotnet restore ${{env.SOLUTION_PATH}}

src/Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@
1313
<PackageIconUrl>https://www.blockcore.net/assets/blockcore-256x256.png</PackageIconUrl>
1414
<PackageTags>blockchain;cryptocurrency;crypto;C#;.NET;bitcoin;blockcore</PackageTags>
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
17+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20+
<DebugType>portable</DebugType>
1621
</PropertyGroup>
1722

23+
<ItemGroup>
24+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
25+
</ItemGroup>
26+
1827
<Target Name="AddInternalsVisibleTo" BeforeTargets="CoreCompile">
1928
<ItemGroup>
2029

0 commit comments

Comments
 (0)