@@ -89,12 +89,20 @@ jobs:
8989 - name : Run .NET tests
9090 run : dotnet test --verbosity normal
9191
92- - name : Pester tests
92+ - name : Run Pester tests
9393 shell : pwsh
9494 run : |
9595 Invoke-Pester -Path ./PsGraph.Pester.Tests/
9696
97- - name : psgallery publish
97+ - name : dotnet publish PowerShell module
98+ run : |
99+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
100+ dotnet publish -c Debug -o "./PSQuickGraph"
101+ else
102+ dotnet publish -c Release -o "./PSQuickGraph"
103+ fi
104+
105+ - name : Publish PowerShell module to PSGallery
98106 shell : pwsh
99107 run : |
100108 Publish-Module -Path "./PSQuickGraph" -NuGetApiKey ${{ secrets.PS_GALLERY_SECRET }}
@@ -130,25 +138,25 @@ jobs:
130138 NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
131139
132140 # --- Commit manifest changes ---
133- # - name: Commit and push updated manifest
134- # if: success()
135- # env:
136- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137- # run: |
138- # git config user.name "github-actions[bot]"
139- # git config user.email "github-actions[bot]@users.noreply.github.com"
140- # SOURCE_BRANCH="${{ github.event.release.target_commitish }}"
141- # if [ -z "$SOURCE_BRANCH" ]; then
142- # echo "Could not determine source branch. Exiting."
143- # exit 1
144- # fi
145- # if [[ "$SOURCE_BRANCH" =~ ^[0-9a-f]{40}$ ]]; then
146- # echo "Commitish is a SHA, not a branch name. Aborting."
147- # exit 1
148- # fi
149- # git fetch origin "$SOURCE_BRANCH"
150- # git switch "$SOURCE_BRANCH"
151- # git pull origin "$SOURCE_BRANCH"
152- # git add ./PSQuickGraph/*.psd1
153- # git commit -m "ci: update module version to ${{ steps.set_version.outputs.version }}" || echo "Nothing to commit"
154- # git push origin "$SOURCE_BRANCH"
141+ - name : Commit and push updated manifest
142+ if : success()
143+ env :
144+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
145+ run : |
146+ git config user.name "github-actions[bot]"
147+ git config user.email "github-actions[bot]@users.noreply.github.com"
148+ SOURCE_BRANCH="${{ github.event.release.target_commitish }}"
149+ if [ -z "$SOURCE_BRANCH" ]; then
150+ echo "Could not determine source branch. Exiting."
151+ exit 1
152+ fi
153+ if [[ "$SOURCE_BRANCH" =~ ^[0-9a-f]{40}$ ]]; then
154+ echo "Commitish is a SHA, not a branch name. Aborting."
155+ exit 1
156+ fi
157+ git fetch origin "$SOURCE_BRANCH"
158+ git switch "$SOURCE_BRANCH"
159+ git pull origin "$SOURCE_BRANCH"
160+ git add ./PSQuickGraph/*.psd1
161+ git commit -m "ci: update module version to ${{ steps.set_version.outputs.version }}" || echo "Nothing to commit"
162+ git push origin "$SOURCE_BRANCH"
0 commit comments