forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: onur-ozkan <[email protected]>
- Loading branch information
1 parent
7cb6d1a
commit 5678fe5
Showing
3 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Download and verify remote files" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download | ||
shell: bash | ||
run: | | ||
if [[ "$RUNNER_OS" == "Windows" ]]; then | ||
Invoke-WebRequest -Uri ${{ inputs.url }} -OutFile ${{ inputs.output_file }} | ||
else | ||
curl -L -o ${{ inputs.output_file }} ${{ inputs.url }} | ||
fi | ||
- name: Verify | ||
shell: bash | ||
run: | | ||
if [[ "$RUNNER_OS" == "Windows" ]]; then | ||
echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | certutil -hashfile - SHA256 | findstr "${{ inputs.checksum }}" | ||
elif [[ "$RUNNER_OS" == "macOS" ]]; then | ||
echo "${{ inputs.checksum }} *${{ inputs.output_file }}" | shasum -a 256 -c | ||
else | ||
echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | sha256sum --check | ||
fi | ||
inputs: | ||
url: | ||
description: "URL of the remote file." | ||
required: true | ||
output_file: | ||
description: "Output path." | ||
required: true | ||
checksum: | ||
description: "Expected checksum of the downloaded file." | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters