Skip to content

Commit 2dcf111

Browse files
Merge branch 'main' into patch-2
2 parents 8a89bc1 + 065e204 commit 2dcf111

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

.github/workflows/chocolatey.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ jobs:
178178
`$ErrorActionPreference = 'Stop'
179179
`$toolsDir = Split-Path -Parent `$MyInvocation.MyCommand.Definition
180180
181-
Remove-Item -Path (Join-Path `$toolsDir 'WinMemoryCleaner.exe') -ErrorAction SilentlyContinue
182-
Remove-Item -Path (Join-Path `$toolsDir 'chocolateyinstall.ps1') -ErrorAction SilentlyContinue
181+
Remove-Item -Path (Join-Path `$toolsDir 'WinMemoryCleaner.exe') -Force -ErrorAction SilentlyContinue
182+
Remove-Item -Path (Join-Path `$toolsDir 'chocolateyinstall.ps1') -Force -ErrorAction SilentlyContinue
183183
184184
`$shortcutPath = Join-Path `$env:ProgramData 'Microsoft\Windows\Start Menu\Programs\WinMemoryCleaner.lnk'
185185
Remove-ChocolateyShortcut -shortcutFilePath `$shortcutPath
@@ -211,20 +211,24 @@ jobs:
211211
212212
- name: Build and Push Chocolatey package
213213
if: steps.check_chocolatey.outputs.skip == 'false'
214-
shell: pwsh
215-
run: |
216-
cd .\chocolatey-package
217-
choco pack
218-
$nupkgFile = Get-ChildItem -Filter "*.nupkg" | Select-Object -First 1
219-
if (-not $nupkgFile) {
220-
Write-Host "::error::No .nupkg file was created by 'choco pack'."
221-
exit 1
222-
}
223-
choco push $nupkgFile.FullName --source https://push.chocolatey.org/ --api-key "${{ secrets.CHOCOLATEY_API_KEY }}"
224-
if ($LASTEXITCODE -ne 0) {
225-
Write-Host "::error::Failed to push package to Chocolatey."
226-
exit 1
227-
}
214+
uses: nick-invision/retry@v2
215+
with:
216+
timeout_seconds: 300
217+
max_attempts: 3
218+
retry_wait_seconds: 60
219+
command: |
220+
cd .\chocolatey-package
221+
choco pack
222+
$nupkgFile = Get-ChildItem -Filter "*.nupkg" | Select-Object -First 1
223+
if (-not $nupkgFile) {
224+
Write-Host "::error::No .nupkg file was created by 'choco pack'."
225+
exit 1
226+
}
227+
choco push $nupkgFile.FullName --source https://push.chocolatey.org/ --api-key "${{ secrets.CHOCOLATEY_API_KEY }}"
228+
if ($LASTEXITCODE -ne 0) {
229+
Write-Host "::error::Failed to push package to Chocolatey."
230+
exit 1
231+
}
228232
229233
- name: Cleanup
230234
if: always()

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ concurrency:
2626
jobs:
2727
check-assembly-version:
2828
name: Check AssemblyVersion Up-to-Date
29+
if: github.base_ref == 'main'
2930
runs-on: ubuntu-latest
3031
steps:
3132
- name: Checkout code

0 commit comments

Comments
 (0)