Skip to content

Commit 235d441

Browse files
committed
add pack nupkg step to workflow
1 parent 7c11997 commit 235d441

4 files changed

Lines changed: 66 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ env:
2020
TEST_PROJECT: TeamTools.TSQL.LinterTests
2121
PUBLISH_PROJECT_PATH: TeamTools.TSQL.Linter/TeamTools.TSQL.Linter.csproj
2222
OUTPUT_PATH: ${{ github.workspace }}/.bin/
23-
PUBLISH_PATH: ${{ github.workspace }}/.pub/
23+
PUBLISH_PATH: ${{ github.workspace }}/.pub
24+
NUPKG_PATH: ${{ github.workspace }}\.nupkgs
2425

2526
jobs:
2627
semver:
@@ -89,6 +90,7 @@ jobs:
8990
run: dotnet --info
9091

9192
- name: Cache NuGet packages
93+
id: cache-nugets
9294
uses: actions/cache@v4
9395
with:
9496
path: ${{ github.workspace }}/packages
@@ -143,33 +145,77 @@ jobs:
143145
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
144146
-p:PublishDir="${{ env.PUBLISH_PATH }}/Release/net8.0"
145147
148+
- name: Pack
149+
if: ${{ matrix.publish }}
150+
run: >
151+
dotnet pack "${{ github.workspace}}\TeamTools.TSQL.Common\TeamTools.Common.Linting.csproj"
152+
--no-build
153+
--output "${{ env.NUPKG_PATH }}"
154+
-p:Configuration=Release
155+
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
156+
-p:VersionPrefix=${{ needs.semver.outputs.next-version }}
157+
&&
158+
dotnet pack "${{ github.workspace}}\TeamTools.TSQL.ExpressionEvaluator\TeamTools.TSQL.ExpressionEvaluator.csproj"
159+
--no-build
160+
--output "${{ env.NUPKG_PATH }}"
161+
-p:Configuration=Release
162+
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
163+
-p:VersionPrefix=${{ needs.semver.outputs.next-version }}
164+
&&
165+
dotnet pack "${{ env.PUBLISH_PROJECT_PATH }}"
166+
--no-build
167+
--output "${{ env.NUPKG_PATH }}"
168+
-p:Configuration=Release
169+
-p:BaseOutputPath="${{ env.OUTPUT_PATH }}"
170+
-p:VersionPrefix=${{ needs.semver.outputs.next-version }}
171+
-p:Authors="Ivan Starostin et al"
172+
-p:Copyright="2019- (c) Ivan Starostin"
173+
-p:RepositoryCommit=${{ github.sha }}
174+
-p:RepositoryUrl="${{ github.repositoryUrl }}"
175+
-p:RepositoryType=git
176+
-p:RepositoryBranch="${{ github.ref_name }}"
177+
146178
- name: Upload build artifacts 2.0
147179
uses: actions/upload-artifact@v4
148180
if: ${{ matrix.publish }}
149181
with:
150182
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-netstandard2.0
151183
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/netstandard2.0
184+
if-no-files-found: error
152185

153186
- name: Upload build artifacts 6.0
154187
uses: actions/upload-artifact@v4
155188
if: ${{ matrix.publish }}
156189
with:
157190
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-net6.0
158191
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/net6.0
192+
if-no-files-found: error
159193

160194
- name: Upload build artifacts 8.0
161195
uses: actions/upload-artifact@v4
162196
if: ${{ matrix.publish }}
163197
with:
164198
name: ${{ env.PRODUCT_NAME }}-${{ needs.semver.outputs.next-version }}-${{ matrix.configuration }}-net8.0
165199
path: ${{ env.PUBLISH_PATH }}/${{ matrix.configuration }}/net8.0
200+
if-no-files-found: error
201+
202+
- name: Upload nugets
203+
uses: actions/upload-artifact@v4
204+
if: ${{ matrix.publish }}
205+
with:
206+
name: nuget-packages
207+
include-hidden-files: true
208+
if-no-files-found: error
209+
path: |
210+
${{ env.NUPKG_PATH }}\*.nupkg
166211
167212
- name: Upload test bundle
168213
uses: actions/upload-artifact@v4
169214
if: ${{ matrix.configuration == 'Debug' && matrix.os == 'windows-latest' && steps.build.conclusion == 'success' && !cancelled() }}
170215
with:
171216
name: test-bundle
172-
path: ${{ env.OUTPUT_PATH }}/${{ matrix.configuration }}/net8.0
217+
path: ${{ env.OUTPUT_PATH }}${{ matrix.configuration }}/net8.0
218+
if-no-files-found: error
173219

174220
- name: Test
175221
if: ${{ !matrix.coverage }}
@@ -194,6 +240,7 @@ jobs:
194240
with:
195241
name: test-results
196242
path: TestResults
243+
if-no-files-found: error
197244

198245
- name: Test Report
199246
uses: dorny/test-reporter@v2
@@ -202,6 +249,7 @@ jobs:
202249
name: NUnit testing ${{ matrix.configuration }} build on ${{ matrix.os }}
203250
path: "**/TestResults/*.trx,*.trx"
204251
reporter: dotnet-trx
252+
if-no-files-found: error
205253

206254
validate-markdown:
207255
runs-on: ubuntu-latest

TeamTools.TSQL.Common/TeamTools.Common.Linting.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<!-- Packing options -->
1010
<PropertyGroup>
1111
<IsPackable>true</IsPackable>
12-
<PackageOutputPath>../.nupkg</PackageOutputPath>
13-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
14-
<PackageReadmeFile>./readme.md</PackageReadmeFile>
15-
<PackageTags>StaticCodeAnalysis;CodeQuality;TeamTools</PackageTags>
12+
<PackageOutputPath>../.nupkgs</PackageOutputPath>
13+
<PackageReadmeFile>readme.md</PackageReadmeFile>
14+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1615
</PropertyGroup>
1716

1817
<!-- Dependencies -->
@@ -22,7 +21,8 @@
2221

2322
<!-- Manual includes -->
2423
<ItemGroup>
25-
<Content Include="readme.md" Pack="true" PackagePath="\" />
24+
<Content Include="readme.md" Pack="true" PackagePath="" />
25+
<Content Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="" />
2626
</ItemGroup>
2727
<ItemGroup>
2828
<Compile Update="Properties\Strings.Designer.cs">

TeamTools.TSQL.ExpressionEvaluator/TeamTools.TSQL.ExpressionEvaluator.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
<!-- Packing options -->
1515
<PropertyGroup>
1616
<IsPackable>true</IsPackable>
17-
<PackageOutputPath>../.nupkg</PackageOutputPath>
18-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
19-
<PackageReadmeFile>./readme.md</PackageReadmeFile>
20-
<PackageTags>T-SQL;tsql;TeamTools</PackageTags>
17+
<PackageOutputPath>../.nupkgs</PackageOutputPath>
18+
<PackageReadmeFile>readme.md</PackageReadmeFile>
19+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2120
<Description>T-SQL scalar expression evaluator</Description>
2221
</PropertyGroup>
2322

@@ -38,7 +37,8 @@
3837

3938
<!-- Manual includes -->
4039
<ItemGroup>
41-
<Content Include="readme.md" Pack="true" PackagePath="\" />
40+
<Content Include="readme.md" Pack="true" PackagePath="" />
41+
<Content Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="" />
4242
</ItemGroup>
4343
<ItemGroup>
4444
<Compile Update="Properties\Strings.Designer.cs">

TeamTools.TSQL.Linter/TeamTools.TSQL.Linter.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66
<Configurations>Debug;Release</Configurations>
77
</PropertyGroup>
88

9-
<!-- Build management -->
10-
<PropertyGroup>
11-
<RunSettingsFilePath>$(MSBuildProjectDirectory)\.runsettings</RunSettingsFilePath>
12-
</PropertyGroup>
13-
149
<!-- Packing options -->
1510
<PropertyGroup>
1611
<IsPackable>true</IsPackable>
17-
<PackageOutputPath>../.nupkg</PackageOutputPath>
18-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
19-
<PackageReadmeFile>./readme.md</PackageReadmeFile>
20-
<PackageTags>T-SQL;tsql;sqlproj;StaticCodeAnalysis;CodeQuality;TeamTools</PackageTags>
12+
<PackageOutputPath>../.nupkgs</PackageOutputPath>
13+
<PackageReadmeFile>readme.md</PackageReadmeFile>
14+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
15+
<PackageTags>T-SQL;tsql;sqlproj;StaticCodeAnalysis;CodeQuality;TeamTools;static-code-analysis;sql-linter</PackageTags>
2116
<Description>Pluggable linter library for T-SQL files organized in SSDT-project manner</Description>
2217
</PropertyGroup>
2318

@@ -34,7 +29,7 @@
3429

3530
<!-- Manual includes -->
3631
<ItemGroup>
37-
<Content Include="..\LICENSE" Pack="true" CopyToOutputDirectory="PreserveNewest" />
32+
<Content Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" CopyToOutputDirectory="PreserveNewest" PackagePath="\" />
3833
<Content Include="DefaultConfig.json" Pack="true" CopyToOutputDirectory="PreserveNewest" />
3934
<Content Include="Resources\SqlServerMetadata.json" Pack="true" CopyToOutputDirectory="PreserveNewest" />
4035
<Content Include="Resources\ViolationMessages.ru-ru.json" Pack="true" CopyToOutputDirectory="PreserveNewest" />
@@ -45,6 +40,7 @@
4540
<Visible>true</Visible>
4641
<Pack>true</Pack>
4742
</Content>
43+
<Content Include="readme.md" Pack="true" PackagePath="\" />
4844
</ItemGroup>
4945
<ItemGroup>
5046
<Compile Update="Properties\Strings.Designer.cs">

0 commit comments

Comments
 (0)