@@ -3,7 +3,7 @@ name: psgraph-publish
33on :
44 release :
55 types : [published]
6-
6+
77 workflow_dispatch :
88
99jobs :
@@ -93,33 +93,12 @@ jobs:
9393 shell : pwsh
9494 run : |
9595 Invoke-Pester -Path ./PsGraph.Pester.Tests/
96-
97- - name : dotnet publish
98- run : dotnet publish -o "./PSQuickGraph"
99-
100- - name : psgallery publish
101- run : |
102- Invoke-Pester -Path ./PsGraph.Pester.Tests/
103-
104- - name : dotnet publish PowerShell module
105- run : |
106- if [ "${{ github.event.release.prerelease }}" = "true" ]; then
107- dotnet publish -c Debug -o "./PSQuickGraph"
108- else
109- dotnet publish -c Release -o "./PSQuickGraph"
110- fi
11196
112- - name : Publish PowerShell module to PSGallery
113- shell : pwsh
97+ - name : psgallery publish
11498 run : |
11599 Publish-Module -Path "./PSQuickGraph" -NuGetApiKey ${{ secrets.PS_GALLERY_SECRET }}
116100
117101 # --- NuGet Common Package Build/Publish ---
118- - name : Set Version Suffix for Pre-release (Common)
119- if : github.event.release.prerelease == true
120- run : |
121- echo "VERSION_SUFFIX=${{ steps.set_version.outputs.prerelease }}" >> $GITHUB_ENV
122-
123102 - name : Build PSGraph.Common (Debug on prerelease, Release on release)
124103 run : |
125104 if [ "${{ github.event.release.prerelease }}" = "true" ]; then
@@ -131,21 +110,18 @@ jobs:
131110 - name : Pack PSGraph.Common (Debug/pre-release on prerelease, Release on release)
132111 shell : bash
133112 run : |
134- if [ "${{ github.event.release .prerelease }}" = "true " ]; then
113+ if [ -n "${{ steps.set_version.outputs .prerelease }}" ]; then
135114 VERSION="${{ steps.set_version.outputs.version }}-${{ steps.set_version.outputs.prerelease }}"
136- dotnet pack PSGraph.Common/PSGraph.Common.csproj \
137- --configuration Debug \
138- --no-build \
139- --output ./nupkg \
140- /p:PackageVersion="$VERSION"
115+ CONFIG=Debug
141116 else
142117 VERSION="${{ steps.set_version.outputs.version }}"
143- dotnet pack PSGraph.Common/PSGraph.Common.csproj \
144- --configuration Release \
145- --no-build \
146- --output ./nupkg \
147- /p:PackageVersion="$VERSION"
118+ CONFIG=Release
148119 fi
120+ dotnet pack PSGraph.Common/PSGraph.Common.csproj \
121+ --configuration $CONFIG \
122+ --no-build \
123+ --output ./nupkg \
124+ /p:PackageVersion="$VERSION"
149125
150126 - name : Publish PSGraph.Common to NuGet
151127 run : dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
0 commit comments