Skip to content

Commit e232328

Browse files
committed
powershell for windows
1 parent 6cf096f commit e232328

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,20 @@ jobs:
7878
- name: Build binary
7979
run: ${{ matrix.CMD_BUILD }}
8080
- name: Generate SHA256
81+
shell: bash
82+
if: runner.os != 'Windows'
8183
run: |
82-
if [ "${{ runner.os }}" = "Windows" ]; then
83-
certutil -hashfile ${{ matrix.OUT_FILE_NAME }} SHA256 | findstr /v "hash" > ${{ matrix.OUT_FILE_NAME }}.sha256
84-
elif [ "${{ runner.os }}" = "macOS" ]; then
84+
if [ "${{ runner.os }}" = "macOS" ]; then
8585
shasum -a 256 ${{ matrix.OUT_FILE_NAME }} > ${{ matrix.OUT_FILE_NAME }}.sha256
8686
else
8787
sha256sum ${{ matrix.OUT_FILE_NAME }} > ${{ matrix.OUT_FILE_NAME }}.sha256
8888
fi
89+
- name: Generate SHA256 (Windows)
90+
if: runner.os == 'Windows'
91+
shell: pwsh
92+
run: |
93+
$hash = (Get-FileHash -Algorithm SHA256 ${{ matrix.OUT_FILE_NAME }}).Hash.ToLower()
94+
$hash + " *${{ matrix.OUT_FILE_NAME }}" | Out-File -Encoding utf8 ${{ matrix.OUT_FILE_NAME }}.sha256
8995
- name: Upload artifacts
9096
uses: actions/upload-artifact@v3
9197
with:

0 commit comments

Comments
 (0)