Skip to content

Commit

Permalink
Refactor build process to include separate checksum generation for Li…
Browse files Browse the repository at this point in the history
…nux binaries
  • Loading branch information
Aitthi committed Sep 29, 2024
1 parent 43df162 commit 06524ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ jobs:

- name: Generate Checksums
run: |
cd build
shasum -a 256 * > checksums.txt
cd build/linux
shasum -a 256 * > linux-checksums.txt
- name: Push binaries to release
uses: softprops/action-gh-release@v1
with:
repository: ${{ github.repository }}
files: |
build/linux/aarch64-easy-proxy-linux-gnu
build/checksums.txt
build/linux/linux-checksums.txt
tag_name: v${{ steps.extract_version.outputs.version }}
name: v${{ steps.extract_version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ echo "Downloading $BINARY_NAME from $DOWNLOAD_URL..."
curl -L "$DOWNLOAD_URL" -o "$BINARY_NAME"

# Download checksums file
CHECKSUM_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/checksums.txt"
CHECKSUM_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/linux-checksums.txt"
echo "Downloading checksums from $CHECKSUM_URL..."
curl -L "$CHECKSUM_URL" -o "checksums.txt"
curl -L "$CHECKSUM_URL" -o "linux-checksums.txt"

# Verify checksum
echo "Verifying checksum..."
EXPECTED_CHECKSUM=$(grep "$BINARY_NAME" checksums.txt | cut -d ' ' -f 1)
EXPECTED_CHECKSUM=$(grep "$BINARY_NAME" linux-checksums.txt | cut -d ' ' -f 1)
ACTUAL_CHECKSUM=$(sha256sum "$BINARY_NAME" | cut -d ' ' -f 1)

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
echo "Checksum verification failed!"
rm "$BINARY_NAME" checksums.txt
rm "$BINARY_NAME" linux-checksums.txt
exit 1
fi

# Clean up checksums file
rm checksums.txt
rm linux-checksums.txt

# Make the binary executable
chmod +x "$BINARY_NAME"
Expand Down

0 comments on commit 06524ec

Please sign in to comment.