Skip to content

Commit 3cafec4

Browse files
timheuerawentzel
andauthored
Improving NuGet package (#107)
* Adding initial full GH workflow * Improving NuGet package * Fix typo * Removing nuget push Co-authored-by: Aaron Wentzel <16669785+awentzel@users.noreply.github.com>
1 parent 830c938 commit 3cafec4

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Build, Sign, Publish"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/*.md'
9+
- '**/*.gitignore'
10+
- '**/*.gitattributes'
11+
workflow_dispatch:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- '**/*.md'
16+
- '**/*.gitignore'
17+
- '**/*.gitattributes'
18+
19+
jobs:
20+
build:
21+
name: Build, Pack, Publish
22+
runs-on: ubuntu-latest
23+
env:
24+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
25+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
26+
DOTNET_NOLOGO: true
27+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
28+
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
29+
DOTNET_MULTILEVEL_LOOKUP: 0
30+
PROJECT: "src/Microsoft.Fast.Components.FluentUI/Microsoft.Fast.Components.FluentUI.csproj"
31+
BUILD_ARCH: "Any CPU"
32+
BUILD_CONFIG: "Release"
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- name: Setup .NET 2.1 for ESRP Sign tool
38+
uses: actions/setup-dotnet@v1.8.1
39+
with:
40+
dotnet-version: 2.1.x
41+
42+
- name: Setup .NET 6
43+
uses: actions/setup-dotnet@v1.8.1
44+
with:
45+
dotnet-version: 6.0.x
46+
include-prerelease: true
47+
48+
- name: Restore
49+
run: dotnet restore ${{ env.PROJECT }}
50+
51+
- name: Build
52+
run: dotnet build ${{ env.PROJECT }} --configuration ${{ env.BUILD_CONFIG }} --no-restore
53+
54+
- name: Test
55+
run: dotnet test
56+
57+
- name: Pack
58+
run: dotnet pack ${{ env.PROJECT }} --configuration ${{ env.BUILD_CONFIG }} -o packed --no-build
59+
60+
# Code signing tool goes here
61+
# example of signing using a code-sign cert
62+
#- name: Sign package
63+
# run: dotnet nuget sign **/*.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.CERT_PWD }} --timestamper http://timestamp.digicert.com
64+
65+
# Uses an API key as the creds
66+
#- name: Publish to NuGet
67+
# run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
68+
69+
- name: Publish artifacts
70+
uses: actions/upload-artifact@v2
71+
with:
72+
name: signednupkg
73+
path: packed

src/Microsoft.Fast.Components.FluentUI/Microsoft.Fast.Components.FluentUI.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<ReleaseVersion>0.5.0</ReleaseVersion>
1919
<SynchReleaseVersion>false</SynchReleaseVersion>
2020
<Nullable>enable</Nullable>
21+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
22+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
23+
<DebugType>embedded</DebugType>
24+
<RepositoryUrl>https://github.com/microsoft/fast-blazor</RepositoryUrl>
25+
<RepositoryType>git</RepositoryType>
26+
<PackageReadmeFile>README.md</PackageReadmeFile>
2127
</PropertyGroup>
2228

2329
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -32,12 +38,24 @@
3238
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
3339
<Optimize>True</Optimize>
3440
</PropertyGroup>
41+
42+
<ItemGroup>
43+
<None Include="..\..\README.md">
44+
<Pack>True</Pack>
45+
<PackagePath>\</PackagePath>
46+
</None>
47+
</ItemGroup>
3548
<ItemGroup>
3649
<SupportedPlatform Include="browser" />
3750
</ItemGroup>
3851

3952
<ItemGroup>
4053
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.0-rc.2.*" />
54+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4155
</ItemGroup>
4256

57+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true' Or '$(TF_BUILD)' == 'true'">
58+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
59+
</PropertyGroup>
60+
4361
</Project>

0 commit comments

Comments
 (0)