Skip to content

Commit 360744f

Browse files
committed
👷 Skip optimization
1 parent d13d3ad commit 360744f

1 file changed

Lines changed: 33 additions & 35 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ jobs:
1414
outputs:
1515
psd1_changed: ${{ steps.has_psd1_changed.outputs.psd1_changed }}
1616
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
with:
20-
sparse-checkout: src/*/*.psd1
21-
fetch-depth: 2
22-
- name: Module update check
23-
id: has_psd1_changed
24-
continue-on-error: true
25-
run: |
26-
gci -r
27-
$change = @(git diff --name-only HEAD~ HEAD -- (Resolve-Path .\src\*\*.psd1)).Count
28-
"psd1_changed=$( $change ? $true : $null )" >> $env:GITHUB_OUTPUT
29-
Get-Content $env:GITHUB_OUTPUT -Raw
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 2
21+
- name: Module update check
22+
id: has_psd1_changed
23+
continue-on-error: true
24+
run: |
25+
$change = @(git diff --name-only HEAD~ HEAD -- (Resolve-Path .\src\*\*.psd1)).Count
26+
"psd1_changed=$( $change ? $true : $null )" >> $env:GITHUB_OUTPUT
27+
Get-Content $env:GITHUB_OUTPUT -Raw
3028
publish:
3129
name: Publish to PowerShell Gallery
3230
runs-on: windows-latest
@@ -35,25 +33,25 @@ jobs:
3533
env:
3634
gallerykey: ${{ secrets.gallerykey }}
3735
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
- name: Build
41-
if: success() && env.gallerykey
42-
run: dotnet build -c Release
43-
- name: Publish
44-
if: success() && env.gallerykey
45-
run: |
46-
#Requires -Version 7
47-
dotnet publish -c Release
48-
$MSBuildProjectName = Resolve-Path src/*/*.fsproj |Split-Path -LeafBase
49-
Join-Path ($env:PSModulePath -split ';') $MSBuildProjectName |
50-
Where-Object {Test-Path $_ -Type Container} |
51-
Remove-Item -Recurse -Force
52-
Push-Location ./src/*/bin/Release/*/publish
53-
Import-LocalizedData Module -FileName $MSBuildProjectName -BaseDirectory "$PWD"
54-
$Version = $Module.ModuleVersion
55-
$InstallPath = "$env:UserProfile/Documents/PowerShell/Modules/$MSBuildProjectName/$Version"
56-
if(!(Test-Path $InstallPath -Type Container)) {mkdir $InstallPath}
57-
Copy-Item * -Destination $InstallPath
58-
Pop-Location
59-
Publish-Module -Name $MSBuildProjectName -NuGetApiKey $env:gallerykey
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Build
39+
if: success() && env.gallerykey
40+
run: dotnet build -c Release
41+
- name: Publish
42+
if: success() && env.gallerykey
43+
run: |
44+
#Requires -Version 7
45+
dotnet publish -c Release
46+
$MSBuildProjectName = Resolve-Path src/*/*.fsproj |Split-Path -LeafBase
47+
Join-Path ($env:PSModulePath -split ';') $MSBuildProjectName |
48+
Where-Object {Test-Path $_ -Type Container} |
49+
Remove-Item -Recurse -Force
50+
Push-Location ./src/*/bin/Release/*/publish
51+
Import-LocalizedData Module -FileName $MSBuildProjectName -BaseDirectory "$PWD"
52+
$Version = $Module.ModuleVersion
53+
$InstallPath = "$env:UserProfile/Documents/PowerShell/Modules/$MSBuildProjectName/$Version"
54+
if(!(Test-Path $InstallPath -Type Container)) {mkdir $InstallPath}
55+
Copy-Item * -Destination $InstallPath
56+
Pop-Location
57+
Publish-Module -Name $MSBuildProjectName -NuGetApiKey $env:gallerykey

0 commit comments

Comments
 (0)