Skip to content

Commit

Permalink
build(github): include README in package
Browse files Browse the repository at this point in the history
  • Loading branch information
seangwright committed Jul 8, 2023
1 parent 74f9b19 commit 2b8011c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
20 changes: 11 additions & 9 deletions .github/actions/pack-and-publish/action.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
name: 'Pack and Publish'
name: "Pack and Publish"

description: 'Packs and publishes a .NET Library as a build artifact'
description: "Packs and publishes a .NET Library as a build artifact"

inputs:
projectPath:
description: 'Path to the project file'
description: "Path to the project file"
required: true
preReleaseVersion:
description: 'The pre-release version to use for the NuGet package'
description: "The pre-release version to use for the NuGet package"
required: true

runs:
using: composite
steps:
- name: Create PreRelease Artifact
run: dotnet pack ${{ inputs.projectPath }} -c Release --no-build --include-symbols -o ./artifacts/prerelease --version-suffix prerelease-${{ inputs.preReleaseVersion }}
run: |
cp ./README.md ./src
dotnet pack ${{ inputs.projectPath }} -c Release -o ./artifacts/prerelease --version-suffix prerelease-${{ inputs.preReleaseVersion }}
shell: pwsh

- name: 'Save prerelease artifact'
- name: "Save prerelease artifact"
uses: actions/upload-artifact@v3
with:
name: prerelease
path: ./artifacts/prerelease/*

- name: Create Release Artifact
run: dotnet pack ${{ inputs.projectPath }} -c Release --no-build --include-symbols -o ./artifacts/release
run: dotnet pack ${{ inputs.projectPath }} -c Release -o ./artifacts/release
shell: pwsh

- name: 'Save release artifact'
- name: "Save release artifact"
uses: actions/upload-artifact@v3
with:
name: release
path: ./artifacts/release/*
path: ./artifacts/release/*
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ jobs:
run: dotnet test --configuration Release --no-build --no-restore

- name: Build Package
run: dotnet build src/templatepack.csproj
run: |
cp ./README.md ./src
dotnet pack ./src/templatepack.csproj -o ./
shell: pwsh
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
- name: Test Solution
run: dotnet test --configuration Release --no-build --no-restore

- name: Build Package
run: dotnet build src/templatepack.csproj

- name: "Pack and Publish"
uses: ./.github/actions/pack-and-publish
with:
Expand Down
3 changes: 3 additions & 0 deletions src/templatepack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PackageType>Template</PackageType>
<PackageVersion>1.0.0</PackageVersion>
<PackageId>XperienceCommunity.DotnetItemTemplates</PackageId>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Title>Xperience Community - .NET Item Templates</Title>
<Authors>Sean G. Wright</Authors>
<Description>.NET CLI Item Templates for Xperience by Kentico projects, usable at the command line or in Visual Studio</Description>
Expand Down Expand Up @@ -31,6 +32,8 @@
<Content Remove="templates\**\node_modules\**" />

<Compile Remove="**\*" />

<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>

0 comments on commit 2b8011c

Please sign in to comment.