name: Test release Managarr to Chocolatey permissions: pull-requests: write contents: write on: workflow_dispatch: jobs: publish-chocolatey-package: name: Publish Chocolatey Package runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Set release assets and version shell: pwsh run: | # mock artifact data mkdir artifacts 'c27e191f4290501287ca16268d9c2029e1f5cd01f7c2ac2be3cdfee80395f719' | Set-Content -Path artifacts/managarr-windows.sha256 '0.4.0' | Set-Content -Path artifacts/release-version # Read the first column from the SHA256 file $windows_sha = Get-Content ./artifacts/managarr-windows.sha256 | ForEach-Object { $_.Split(' ')[0] } Add-Content -Path $env:GITHUB_ENV -Value "WINDOWS_SHA=$windows_sha" # Read the release version from the release-version file $release_version = Get-Content ./artifacts/release-version Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_VERSION=$release_version" - name: Package and Publish package to Chocolatey run: | mkdir ./deployment/chocolatey/tools # Run packaging script python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/managarr.nuspec.template" "./deployment/chocolatey/managarr.nuspec" ${{ env.WINDOWS_SHA }} python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/chocolateyinstall.ps1.template" "./deployment/chocolatey/tools/chocolateyinstall.ps1" ${{ env.WINDOWS_SHA }} # Publish to Chocolatey cd ./deployment/chocolatey choco pack echo y | choco install managarr -dv -s . refreshenv $version = managarr --version $version = $version -replace " ", "." choco push $version.nupkg -s https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }};