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.
- Loading branch information
Showing
144 changed files
with
6,606 additions
and
9,895 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,46 @@ | ||
name: "Download and verify remote files" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download (Unix) | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
run: curl -L -o ${{ inputs.output_file }} ${{ inputs.url }} | ||
|
||
- name: Download (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: Invoke-WebRequest -Uri ${{ inputs.url }} -OutFile ${{ inputs.output_file }} | ||
|
||
- name: Verify (Unix) | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
run: | | ||
if [[ "$RUNNER_OS" == "macOS" ]]; then | ||
echo "${{ inputs.checksum }} *${{ inputs.output_file }}" | shasum -a 256 -c | ||
else | ||
echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | sha256sum -c | ||
fi | ||
- name: Verify (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: | | ||
$expectedChecksum = "${{ inputs.checksum }}" | ||
$actualChecksum = (Get-FileHash -Path "${{ inputs.output_file }}" -Algorithm SHA256).Hash | ||
if ($expectedChecksum -ne $actualChecksum) { | ||
Write-Output "Checksum did not match! Expected: $expectedChecksum, Found: $actualChecksum" | ||
exit 1 | ||
} | ||
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.