Skip to content

Commit 6ec4c64

Browse files
committed
still fixing pipelines :)
1 parent 8ebf533 commit 6ec4c64

File tree

1 file changed

+43
-48
lines changed

1 file changed

+43
-48
lines changed

.github/workflows/publish.yml

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,47 @@ jobs:
1818
uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
21+
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
22+
uses: actions/setup-dotnet@v3
23+
with:
24+
dotnet-version: ${{ matrix.dotnet-version }}
25+
- name: Install PowerShell
26+
uses: PSModule/install-powershell@v1
27+
with:
28+
Version: latest
29+
30+
- name: Ensure release tag exists
31+
id: ensure_tag
32+
run: |
33+
if [ -z "${GITHUB_REF##refs/tags/}" ]; then
34+
echo "Error: Release must have a tag."
35+
exit 1
36+
fi
37+
38+
- name: Install dependencies
39+
run: dotnet restore
40+
- name: Build PowerShell module
41+
run: |
42+
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
43+
dotnet build -c Debug
44+
else
45+
dotnet build -c Release
46+
fi
47+
48+
- name: Run .NET tests
49+
run: dotnet test --verbosity normal
50+
- name: Run Pester tests
51+
shell: pwsh
52+
run: |
53+
Invoke-Pester -Path ./PsGraph.Pester.Tests/
54+
55+
- name: dotnet publish PowerShell module
56+
run: |
57+
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
58+
dotnet publish -c Debug -o "./PSQuickGraph"
59+
else
60+
dotnet publish -c Release -o "./PSQuickGraph"
61+
fi
2162
2263
# --- Manual Version Reminder / Guard ---
2364
- name: Verify manifest version matches release tag (manual update reminder)
@@ -30,7 +71,7 @@ jobs:
3071
Write-Error 'Bad tag'; exit 1
3172
}
3273
$ver = $Matches[1]; $pre = $Matches[2]
33-
$manifest = Join-Path $PWD 'PSGraph/PSQuickGraph.psd1'
74+
$manifest = Join-Path $PWD 'PSQuickGraph/PSQuickGraph.psd1'
3475
3576
$md = Test-ModuleManifest -Path $manifest
3677
@@ -62,25 +103,7 @@ jobs:
62103
Write-Host "Manifest version check passed ($moduleVersion$suffix)."
63104
}
64105
65-
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
66-
uses: actions/setup-dotnet@v3
67-
with:
68-
dotnet-version: ${{ matrix.dotnet-version }}
69-
70-
- name: Install PowerShell
71-
uses: PSModule/install-powershell@v1
72-
with:
73-
Version: latest
74-
75106
# --- PowerShell Module Versioning ---
76-
- name: Ensure release tag exists
77-
id: ensure_tag
78-
run: |
79-
if [ -z "${GITHUB_REF##refs/tags/}" ]; then
80-
echo "Error: Release must have a tag."
81-
exit 1
82-
fi
83-
84107
- name: Extract version from tag and update module manifest
85108
id: set_version
86109
shell: pwsh
@@ -91,11 +114,10 @@ jobs:
91114
Write-Error 'Bad tag'; exit 1
92115
}
93116
$ver = $Matches[1]; $pre = $Matches[2]
94-
$manifest = Join-Path $PWD 'PSGraph/PSQuickGraph.psd1'
117+
$manifest = Join-Path $PWD 'PSQuickGraph/PSQuickGraph.psd1'
95118
96119
$md = Test-ModuleManifest -Path $manifest
97120
98-
99121
if ($pre) {
100122
Update-ModuleManifest -Path $manifest -ModuleVersion $ver -Prerelease $pre
101123
} else {
@@ -106,33 +128,6 @@ jobs:
106128
"prerelease=$pre" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
107129
108130
# --- PowerShell Module Build/Test/Publish ---
109-
- name: Install dependencies
110-
run: dotnet restore
111-
112-
- name: Build PowerShell module
113-
run: |
114-
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
115-
dotnet build -c Debug
116-
else
117-
dotnet build -c Release
118-
fi
119-
120-
- name: Run .NET tests
121-
run: dotnet test --verbosity normal
122-
123-
- name: Run Pester tests
124-
shell: pwsh
125-
run: |
126-
Invoke-Pester -Path ./PsGraph.Pester.Tests/
127-
128-
- name: dotnet publish PowerShell module
129-
run: |
130-
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
131-
dotnet publish -c Debug -o "./PSQuickGraph"
132-
else
133-
dotnet publish -c Release -o "./PSQuickGraph"
134-
fi
135-
136131
- name: Publish PowerShell module to PSGallery
137132
shell: pwsh
138133
run: |

0 commit comments

Comments
 (0)