diff options
Diffstat (limited to '.github/workflows/release.yml')
| -rw-r--r-- | .github/workflows/release.yml | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 091a43e..cd87d19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,18 +57,29 @@ jobs: with: go-version: stable - - name: Install zip via Chocolatey (PowerShell) + - name: Package on Windows (PowerShell) if: runner.os == 'Windows' shell: pwsh run: | - # Install the CLI - choco install zip.commandline --no-progress -y - # Load the helper module and refresh the environment - $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Source)\..\.." - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - refreshenv # activates zip in current session + $GOARCH = "${{ matrix.target.split('/')[1] }}" + $GOOS = "windows" + $BIN = "eko.exe" + $DEST = "dist/eko-${GOARCH}-$GOOS.zip" + + # Maybe: Compress-Archive -Path $BIN or use Get-ChildItem + Compress-Archive -LiteralPath $BIN -DestinationPath $DEST + + # Compute SHA256 checksum – via built-in command or external tool if missing + if (Get-Command shasum -ErrorAction SilentlyContinue) { + shasum -a 256 $DEST | Out-File "$DEST.sha256" -Encoding ascii + } else { + # fallback: use PowerShell's Get-FileHash + $hash = (Get-FileHash $DEST -Algorithm SHA256).Hash + "$hash $(Split-Path $DEST -Leaf)" | Out-File "$DEST.sha256" + } - name: Build binary + if: runner.os != 'Windows' shell: bash run: | TARGET="${{ matrix.target }}" |
