Skip to content

Commit

Permalink
Try psutil to create checksum on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Sep 8, 2024
1 parent b067a2a commit e28657d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,23 @@ runs:
--archive-name "${{ inputs.archive-name }}" \
--changes-file "${{ inputs.changes-file }}" \
--extra-files "${{ inputs.extra-files }}"
- name: Generate SHA-256 checksum file (*nix)
- name: Install psutils on Windows
shell: powershell
run: choco install --ignore-checksums psutils
if: runner.os == 'Windows'
- name: Generate SHA-256 checksum file
shell: bash
run: |
shasum -a 256 \
set -e
set -x
SHASUM="shasum"
if [ "${{ runner.os }}" == "Windows" ]; then
SHASUM=/c/programdata/chocolatey/lib/psutils/tools/psutils-master//shasum.ps1
fi
"$SHASUM" -a 256 \
"${{ steps.package-archive.outputs.archive-basename }}" \
> "${{ steps.package-archive.outputs.archive-basename }}.sha256"
if: runner.os != 'Windows'
- name: Generate SHA-256 checksum file (Windows)
shell: powershell
run: |
$hash = $(CertUtil -hashfile ${{ steps.package-archive.outputs.archive-basename }} SHA256)[1]
echo "${{ steps.package-archive.outputs.archive-basename }} $hash" > "${{ steps.package-archive.outputs.archive-basename }}.sha256"
if: runner.os == 'Windows'
- name: Publish release artifact for run
id: publish-release-artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit e28657d

Please sign in to comment.