18
18
uses : actions/checkout@v3
19
19
with :
20
20
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
21
62
22
63
# --- Manual Version Reminder / Guard ---
23
64
- name : Verify manifest version matches release tag (manual update reminder)
30
71
Write-Error 'Bad tag'; exit 1
31
72
}
32
73
$ver = $Matches[1]; $pre = $Matches[2]
33
- $manifest = Join-Path $PWD 'PSGraph /PSQuickGraph.psd1'
74
+ $manifest = Join-Path $PWD 'PSQuickGraph /PSQuickGraph.psd1'
34
75
35
76
$md = Test-ModuleManifest -Path $manifest
36
77
@@ -62,25 +103,7 @@ jobs:
62
103
Write-Host "Manifest version check passed ($moduleVersion$suffix)."
63
104
}
64
105
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
-
75
106
# --- 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
-
84
107
- name : Extract version from tag and update module manifest
85
108
id : set_version
86
109
shell : pwsh
@@ -91,11 +114,10 @@ jobs:
91
114
Write-Error 'Bad tag'; exit 1
92
115
}
93
116
$ver = $Matches[1]; $pre = $Matches[2]
94
- $manifest = Join-Path $PWD 'PSGraph /PSQuickGraph.psd1'
117
+ $manifest = Join-Path $PWD 'PSQuickGraph /PSQuickGraph.psd1'
95
118
96
119
$md = Test-ModuleManifest -Path $manifest
97
120
98
-
99
121
if ($pre) {
100
122
Update-ModuleManifest -Path $manifest -ModuleVersion $ver -Prerelease $pre
101
123
} else {
@@ -106,33 +128,6 @@ jobs:
106
128
"prerelease=$pre" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
107
129
108
130
# --- 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
-
136
131
- name : Publish PowerShell module to PSGallery
137
132
shell : pwsh
138
133
run : |
0 commit comments