Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Feb 22, 2024
1 parent b6d7537 commit 3749b4b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 23 deletions.
6 changes: 2 additions & 4 deletions .github/actions/gradle-and-sha/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ runs:
- name: "Rename output file"
shell: bash
run: |
mv ${{ inputs.intermediate-filepath }} ${{ inputs.final-filepath }}
run: mv ${{ inputs.intermediate-filepath }} ${{ inputs.final-filepath }}

- name: "Generate SHA512"
shell: bash
run: |
./.github/workflows/sha.sh ${{ inputs.final-filepath }} ${{ runner.os }} 512 > ${{ inputs.final-finalpath }}.sha512
run: ./.github/workflows/sha.sh ${{ inputs.final-filepath }} ${{ runner.os }} 512 > ${{ inputs.final-finalpath }}.sha512
4 changes: 1 addition & 3 deletions .github/actions/sha-of-zip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
set ZIP_FILEPATH=%1
set SHA_A=%2

:: NOTE: This script must be placed one level up from the rcv directory

setlocal EnableExtensions EnableDelayedExpansion

set "HASHFILE_UNSORTED=all_hashes_unsorted.txt"
Expand Down Expand Up @@ -45,6 +43,6 @@ for /f "delims=" %%A in ('type "%HASHFILE_UNSORTED%"') do (

sort "%HASHFILE_PATH_STRIPPED%" > "%HASHFILE_SORTED%"

C:\Windows\System32\certutil.exe -hashfile %HASHFILE_SORTED% SHA%SHA_A%
C:\Windows\System32\certutil.exe -hashfile %HASHFILE_SORTED% SHA%SHA_A% | findstr /v ":"

endlocal
6 changes: 3 additions & 3 deletions .github/actions/sha-of-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e

zipFilepath=$1
os=$2
a=$3
sha_a=$3

parentPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

Expand All @@ -23,9 +23,9 @@ unzip -q $zipFilepath -d $tempDirectory 2>/dev/null
# Get a checksum for each file in the zip
cd $tempDirectory
for filename in $(find * -type f | sort); do
checksum=$($parentPath/../workflows/sha.sh $filename $os $a)
checksum=$($parentPath/../workflows/sha.sh $filename $os $sha_a)
echo $checksum >> $tempAllChecksumsFile
done

# Echo the checksum of the checksums
echo $($parentPath/../workflows/sha.sh $tempAllChecksumsFile $os $a)
echo $($parentPath/../workflows/sha.sh $tempAllChecksumsFile $os $sha_a)
4 changes: 2 additions & 2 deletions .github/actions/sha-of-zip/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: "Create SHA of a .zip file by extracting it"
description: "Cross-platform helper: checksum of checksums to be timestamp-independent"
description: "Cross-platform helper: timestamp-independent .zip checksum done via zip expansion"

inputs:
zipFilename:
description: "The output file name"
required: true
shaA:
description: "The sha strategy (1, 256, or 512)"
description: "The sha version (1, 256, or 512)"
required: true

runs:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ jobs:
zipFilename: ${{ steps.zipfn.outputs.FILEPATH }}
shaA: 512

- name: "Generate Golden SHA512 for plugins cache"
uses: ./.github/actions/sha-of-zip
with:
zipFilename: ${{steps.cachefn.outputs.FILEPATH}}
shaA: 512

- name: "Prepare keychain"
if: matrix.os == 'macOS-latest'
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set -e

filename=$1
os=$2
a=$3
sha_a=$3

if [ $os == 'Windows' ]; then
echo $(certutil -hashfile $filename SHA$a | sed -n 2p)
echo $(certutil -hashfile $filename SHA$sha_a | sed -n 2p)
elif [ $os == 'Linux' ]; then
echo $(sha${a}sum $filename | cut -f1 -d" ")
echo $(sha${sha_a}sum $filename | cut -f1 -d" ")
else
echo $(shasum -a $a $filename | cut -f1 -d" ")
echo $(shasum -a $sha_a $filename | cut -f1 -d" ")
fi

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ On Linux, you may install the .deb file, then run `/opt/rcv/bin/RCTab` to launch
3. Download the appropriate cache files for your OS: cache.[OS].zip
4. Stop the gradle daemon with `gradle --stop`
5. Delete the directory ~/.gradle/caches if it exists
6. Extract cache.[OS].zip to ~/.gradle/caches so that the "caches" directory is in ~/.gradle
6. Extract the appropriate caches/[filename].zip to ~/.gradle/caches so that the "caches" directory is in ~/.gradle
7. In the extracted directory, you may manually verify each dependency using checksums.csv in accordance with your own policies
8. Run `gradle assemble --offline` and ensure you get no errors
9. Run `gradle run --offline` to launch RCTab
Expand Down

0 comments on commit 3749b4b

Please sign in to comment.