Skip to content

Commit

Permalink
Improving NuGet package (#107)
Browse files Browse the repository at this point in the history
* Adding initial full GH workflow

* Improving NuGet package

* Fix typo

* Removing nuget push

Co-authored-by: Aaron Wentzel <[email protected]>
  • Loading branch information
timheuer and awentzel authored Oct 29, 2021
1 parent 830c938 commit 3cafec4
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/cicd_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Build, Sign, Publish"

on:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
workflow_dispatch:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'

jobs:
build:
name: Build, Pack, Publish
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
DOTNET_MULTILEVEL_LOOKUP: 0
PROJECT: "src/Microsoft.Fast.Components.FluentUI/Microsoft.Fast.Components.FluentUI.csproj"
BUILD_ARCH: "Any CPU"
BUILD_CONFIG: "Release"

steps:
- uses: actions/checkout@v2

- name: Setup .NET 2.1 for ESRP Sign tool
uses: actions/[email protected]
with:
dotnet-version: 2.1.x

- name: Setup .NET 6
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
include-prerelease: true

- name: Restore
run: dotnet restore ${{ env.PROJECT }}

- name: Build
run: dotnet build ${{ env.PROJECT }} --configuration ${{ env.BUILD_CONFIG }} --no-restore

- name: Test
run: dotnet test

- name: Pack
run: dotnet pack ${{ env.PROJECT }} --configuration ${{ env.BUILD_CONFIG }} -o packed --no-build

# Code signing tool goes here
# example of signing using a code-sign cert
#- name: Sign package
# run: dotnet nuget sign **/*.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.CERT_PWD }} --timestamper http://timestamp.digicert.com

# Uses an API key as the creds
#- name: Publish to NuGet
# run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

- name: Publish artifacts
uses: actions/upload-artifact@v2
with:
name: signednupkg
path: packed
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<ReleaseVersion>0.5.0</ReleaseVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
<Nullable>enable</Nullable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<RepositoryUrl>https://github.com/microsoft/fast-blazor</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -32,12 +38,24 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

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

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true' Or '$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

</Project>

0 comments on commit 3cafec4

Please sign in to comment.