Skip to content

Commit

Permalink
Fix/publish release (#939)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it

We got some feedback on the chocolatey package:
https://community.chocolatey.org/packages/ocm-cli/0.14.0

#### Which issue(s) this PR fixes

should fix the failures during the last `Publish Release` run -
https://github.com/open-component-model/ocm/actions/runs/10851542348
  • Loading branch information
hilmarf authored Sep 26, 2024
1 parent 3cfa228 commit 18e0e46
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
name: aur
key: ${{ secrets.ARCHLINUX_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.ARCHLINUX_SSH_KNOWN_HOSTS }}
known_hosts: ${{ secrets.ARCHLINUX_KNOWN_HOSTS }}
config: ${{ secrets.ARCHLINUX_SSH_CONFIG}}
- name: Setup git config
run: |
Expand Down
4 changes: 2 additions & 2 deletions hack/chocolatey/ocm-cli.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<metadata>
<id>ocm-cli</id>
<version>$version$</version>
<packageSourceUrl>https://github.com/open-component-model/ocm/releases/latest</packageSourceUrl>
<packageSourceUrl>https://github.com/open-component-model/ocm/tree/main/hack/chocolatey</packageSourceUrl>
<!-- owners is a poor name for maintainers of the package. It sticks around by this name for compatibility reasons. It basically means you. -->
<owners>SAP SE</owners>
<!-- This section is about the software itself -->
<title>Open Component Model Command Line Interface (ocm-cli)</title>
<!-- https://github.com/open-component-model/ocm/graphs/contributors -->
<authors>ccwienk, dee0sap, fabianburth, frewilhelm, hilmarf, ikhandamirov, jensh007, jmickey, jschicktanz, mandelsoft, MartinWeindel, maximilianbraun, maximiliantech, morri-son, morrison-sap, nikimanoledaki, phoban01, robertwol, Shegox, shivenduverma-sap, Skarlso, souleb, vasu1124, yitsushi</authors>
<authors>ccwienk, dee0sap, fabianburth, frewilhelm, hilmarf, ikhandamirov, jakobmoellerdev, jensh007, jmickey, jschicktanz, mandelsoft, MartinWeindel, maximilianbraun, maximiliantech, morri-son, morrison-sap, nikimanoledaki, phoban01, robertwol, Shegox, shivenduverma-sap, Skarlso, souleb, vasu1124, yitsushi</authors>
<!-- projectUrl is required for the community feed -->
<projectUrl>https://ocm.software/</projectUrl>
<!-- There are a number of CDN Services that can be used for hosting the Icon for a package. More information can be found here: https://docs.chocolatey.org/en-us/create/create-packages#package-icon-guidelines -->
Expand Down
22 changes: 0 additions & 22 deletions hack/chocolatey/tools/chocolateyuninstall.ps1

This file was deleted.

10 changes: 6 additions & 4 deletions hack/chocolatey/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ $response = Invoke-RestMethod -Uri $url -Headers @{ "User-Agent" = "PowerShell"
$latestVersion = $response.tag_name -replace '^v', ''
Write-Output "The latest released ocm-cli version is $latestVersion"
$assets = $response.assets
$url = $assets | Where-Object { $_.name -match 'windows-386.zip' } | Select-Object -ExpandProperty browser_download_url
$url64 = $assets | Where-Object { $_.name -match 'windows-amd64.zip' } | Select-Object -ExpandProperty browser_download_url
$sha256url = $assets | Where-Object { $_.name -match 'windows-386.zip.sha256' } | Select-Object -ExpandProperty browser_download_url
$sha256url64 = $assets | Where-Object { $_.name -match 'windows-amd64.zip.sha256' } | Select-Object -ExpandProperty browser_download_url
$url = $assets | Where-Object { $_.name -match 'windows-386.zip$' } | Select-Object -ExpandProperty browser_download_url
$url64 = $assets | Where-Object { $_.name -match 'windows-amd64.zip$' } | Select-Object -ExpandProperty browser_download_url
$sha256url = $assets | Where-Object { $_.name -match 'windows-386.zip.sha256$' } | Select-Object -ExpandProperty browser_download_url
$sha256url64 = $assets | Where-Object { $_.name -match 'windows-amd64.zip.sha256$' } | Select-Object -ExpandProperty browser_download_url
$sha256 = [System.Text.Encoding]::UTF8.GetString((Invoke-WebRequest -Uri $sha256url).Content)
$sha256_64 = [System.Text.Encoding]::UTF8.GetString((Invoke-WebRequest -Uri $sha256url64).Content)

Expand All @@ -48,6 +48,8 @@ $description += "`nContinue reading on [ocm.software / cli-reference](https://oc
# release notes do hopefully not contain xml tags
$releaseNotes = Get-Content -Path "docs\releasenotes\v$latestVersion.md" -Raw
$releaseNotes = $releaseNotes -replace '\(#(\d+)\)', '([$1](https://github.com/open-component-model/ocm/pull/$1))'
$releaseNotes = $releaseNotes -replace '<summary>.*</summary>', ''
$releaseNotes = $releaseNotes -replace '</?details>', ''
$updatedContent = $updatedContent -replace '(?ms)<description>.*<\/description>', "<description>$description</description>"
$updatedContent = $updatedContent -replace '(?ms)<releaseNotes>.*<\/releaseNotes>', "<releaseNotes>$releaseNotes</releaseNotes>"
Set-Content -Path $nuspecPath -Value $updatedContent
Expand Down

0 comments on commit 18e0e46

Please sign in to comment.