Skip to content

Commit

Permalink
chore: test replace files checksum 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwelbm committed Jan 8, 2025
1 parent 5753d22 commit 6e10f0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 222 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/packages-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Update nuspec version
run: |
$nuspecPath = Resolve-Path .\chocolatey\mdz.nuspec
if (-Not (Test-Path $nuspecPath)) {
Write-Error "The nuspec file was not found at $nuspecPath"
exit 1
}
Write-Host "Updating nuspec version to ${{ needs.get_branch.outputs.version }}"
(Get-Content $nuspecPath) -replace '<version>.*</version>', "<version>${{ needs.get_branch.outputs.version }}</version>" | Set-Content $nuspecPath
shell: pwsh

- name: Download and extract ZIP
run: |
$toolsDir = "$(Resolve-Path .\chocolatey\tools)"
Expand All @@ -96,20 +83,22 @@ jobs:
Expand-Archive -Path $zipFile -DestinationPath $toolsDir -Force
shell: pwsh

- name: Checksum
- name: Prepare
run: |
# Checksum Calculate
$outputFile = "$(Resolve-Path .\chocolatey\tools\mdz.exe)"
$checksum = (Get-FileHash -Path $outputFile -Algorithm SHA256).Hash
# Replace checksum in chocolateyinstall.ps1 and VERIFICATION.txt
(Get-Content .\chocolatey\tools\chocolateyinstall.ps1) `
-replace '{{CHECKSUM}}', '${{ steps.calculate-checksum.outputs.checksum }}' `
| Set-Content .\chocolatey\tools\chocolateyinstall.ps1
Write-Host "Updating nuspec version to ${{ needs.get_branch.outputs.version }}"
$nuspecPath = Resolve-Path .\chocolatey\mdz.nuspec
(Get-Content $nuspecPath) -replace '<version>.*</version>', "<version>${{ needs.get_branch.outputs.version }}</version>" | Set-Content $nuspecPath
Write-Host "Updating Checksum files $checksum"
$chocoInstallPath = Resolve-Path .\chocolatey\tools\chocolateyinstall.ps1
(Get-Content $chocoInstallPath) -replace '{{CHECKSUM}}', "$checksum" | Set-Content $chocoInstallPath
(Get-Content .\chocolatey\tools\VERIFICATION.txt) `
-replace '{{CHECKSUM}}', '${{ steps.calculate-checksum.outputs.checksum }}' `
| Set-Content .\chocolatey\tools\VERIFICATION.txt
$verificationPath = Resolve-Path .\chocolatey\tools\VERIFICATION.txt
(Get-Content $verificationPath) -replace '{{CHECKSUM}}', "$checksum" | Set-Content $verificationPath
shell: pwsh

- name: Publish Chocolatey package
Expand Down
201 changes: 0 additions & 201 deletions chocolatey/tools/LICENSE.txt

This file was deleted.

0 comments on commit 6e10f0a

Please sign in to comment.