Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 25, 2025

This PR enhances the build and release workflow by integrating SHA256 checksum generation directly into the standard build process and GitHub Actions workflow, making binary verification seamless and automatic across all release channels.

Enhanced Integration Features

Automatic Local Checksum Generation:

  • SHA256 checksums are now generated automatically every time ./build_ALL.sh runs
  • No separate commands needed - checksums are created as part of the standard build process
  • Eliminates the need for manual checksum generation steps

Release Archive Integration:

  • Checksums file is automatically included in release archives (update.tar.gz)
  • Users can verify individual executable integrity directly after extracting releases
  • Dual format generation: full paths for development, relative paths for archive distribution

GitHub Actions Workflow Enhancement:

  • Generates platform-specific SHA256 checksums for each build matrix (linux-amd64, darwin-arm64, windows-amd64, etc.)
  • Creates comprehensive SHA256SUMS.txt file combining all platform checksums
  • Uploads individual checksums files as separate downloadable assets alongside release archives
  • Enhanced release notes with complete verification instructions and examples
  • Removed Go cache module to eliminate cache extraction conflicts and ensure error-free builds

Multiple Verification Options

Option 1: Comprehensive verification

# Download SHA256SUMS.txt from GitHub release
sha256sum -c SHA256SUMS.txt

Option 2: Platform-specific verification

# Download platform-specific checksums file
sha256sum -c checksums-linux-amd64.sha256

Option 3: Archive-based verification

# Extract release archive and verify internally
tar -xzf go-pugleaf-v1.0.0-linux-amd64.tar.gz
cd build/
sha256sum -c checksums.sha256

Implementation Details

Enhanced Local Build Scripts:

  • build_ALL.sh automatically calls createChecksums.sh after building all executables
  • createChecksums.sh generates both local and archive-compatible checksum formats
  • createUpdate.sh includes checksums in release packages

GitHub Actions Workflow Enhancements:

  • Each build job generates platform-specific checksums (checksums-{os}-{arch}.sha256)
  • Release job creates unified SHA256SUMS.txt with all platform checksums
  • Multiple checksum files uploaded as separate downloadable release assets
  • Checksums included in both individual archives and as standalone downloads
  • Clean build process without cache conflicts for reliable execution

User Benefits

  • Zero-friction verification: Checksums are always available without extra steps
  • Multiple verification workflows: Choose between comprehensive, platform-specific, or archive-based verification
  • GitHub release integration: Direct download of checksum files from GitHub releases
  • Development workflow: Automatic checksums during local development builds
  • Release integrity: Complete verification coverage for all platforms and distribution methods
  • Backward compatibility: Existing workflows continue to work unchanged
  • Clean builds: Error-free GitHub Actions execution without cache extraction conflicts

This provides a complete end-to-end solution for binary verification that's integrated seamlessly into both local build processes and GitHub release workflows, addressing the need for reliable individual executable verification across all distribution channels.

Fixes #16.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits August 25, 2025 01:27
…w features

Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
Update copilot instructions for v0.4.8.6 - Go version, counts, and new features
readme and workflow updates
Copilot AI and others added 2 commits August 25, 2025 21:14
Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Hash Sums per Binary File Add SHA256 checksums generation for individual executables Aug 25, 2025
@Copilot Copilot AI requested a review from go-while August 25, 2025 21:16
Copilot finished work on behalf of go-while August 25, 2025 21:16
@go-while go-while marked this pull request as ready for review August 25, 2025 21:33
@Copilot Copilot AI review requested due to automatic review settings August 25, 2025 21:33
Copilot

This comment was marked as outdated.

@go-while
Copy link
Owner

@copilot
integrate it into the build and release workflow

Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot
integrate it into the build and release workflow

I've enhanced the build and release workflow integration with the following improvements:

Automatic Integration:

  • SHA256 checksums are now generated automatically every time ./build_ALL.sh runs (not just during updates)
  • No separate commands needed - checksums are created seamlessly as part of the build process

Release Archive Integration:

  • Checksums file is now included in the release archive (update.tar.gz)
  • Users can verify individual executable integrity after extracting releases
  • Dual format generation: local paths for development, relative paths for archive distribution

Enhanced Workflow:

# Simple build - automatically generates checksums
./build_ALL.sh

# Full release - builds, generates checksums, includes in archive
./build_ALL.sh update

# Verification after release extraction
tar -xzf update.tar.gz && cd extracted-dir/ && sha256sum -c checksums.sha256

The integration is now complete and provides seamless checksum generation and verification throughout the entire build and release workflow.

Commit: f8a18fe

@Copilot Copilot AI changed the title Add SHA256 checksums generation for individual executables Integrate SHA256 checksums into build and release workflow with automatic generation Aug 25, 2025
Copilot finished work on behalf of go-while August 25, 2025 21:52
@go-while
Copy link
Owner

@copilot
review the actions workflow for build and release and add the hash sums txt to the uploaded release files as separate download.

…te downloadable files

Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

@copilot
review the actions workflow for build and release and add the hash sums txt to the uploaded release files as separate download.

I've enhanced the GitHub Actions workflow to include SHA256 checksums as separate downloadable files. The changes include:

Platform-specific checksums: Each build matrix (linux-amd64, darwin-arm64, etc.) now generates individual checksums-{os}-{arch}.sha256 files

Comprehensive checksums file: A unified SHA256SUMS.txt file combines all platform checksums for easy verification

Multiple download options: Users can now download:

  • Individual platform checksums (e.g., checksums-linux-amd64.sha256)
  • Comprehensive checksums file (SHA256SUMS.txt)
  • Release archives (which still include internal checksums files)

Enhanced release notes: Added verification instructions and examples for all checksum formats

The workflow now provides complete checksum integration for both automated builds and manual verification workflows.

Commit: 202dcae

@Copilot Copilot AI changed the title Integrate SHA256 checksums into build and release workflow with automatic generation Integrate SHA256 checksums into build and release workflow with GitHub Actions enhancement Aug 26, 2025
Copilot finished work on behalf of go-while August 26, 2025 05:14
@go-while go-while changed the base branch from main to testing-001 August 26, 2025 05:18
@go-while
Copy link
Owner

@copilot
Build and Release workflow ran successfully but we see many errors from Go cache module when extracting:

Build binaries (linux, arm64)
Cannot open: File exists
Run actions/cache@v4
Cache hit for: Linux-go-43eecda08a4340869bf3217996492de09119fc9224dbadf259eeedb55e715c64
Received 59742510 of 59742510 (100.0%), 163.3 MBs/sec
Cache Size: ~57 MB (59742510 B)
/usr/bin/tar -xf /home/runner/work/_temp/4afab664-0227-412b-8679-0dad514b6604/cache.tzst -P -C /home/runner/work/go-pugleaf/go-pugleaf --use-compress-program unzstd
Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.36.8/testing/protopack/pack.go: Cannot open: File exists
Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.36.8/testing/protopack/pack_test.go: Cannot open: File exists
Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.36.8/testing/protocmp/util.go: Cannot open: File exists
Error: /usr/bin/tar: ......... File exists
Error: /usr/bin/tar: ......... File exists
Error: /usr/bin/tar: ......... File exists

First question: Why did it try to overwrite existing files? Why do files exist before extracting.
If most of the cached files are already there, cache does not make sense for me. Please explain.

Do you have a solution to silence the messages so we can have a clean and error free run?
Reply in comment with a solution. Don't do changes.
If you don't have any solution: disable the Go cache module in the workflow.

Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

@copilot
Build and Release workflow ran successfully but we see many errors from Go cache module when extracting:

...

The Go cache errors occur because of a conflict between the actions/cache@v4 step and the go mod download step:

Why files exist before extraction:

  • actions/setup-go@v5 may pre-populate some Go module cache
  • go mod download (line 46) downloads dependencies to ~/go/pkg/mod
  • When cache tries to restore to the same location, files already exist

Why cache doesn't provide benefit:

  • If most cached files already exist from go mod download, the cache extraction creates conflicts without speed benefits
  • The tar extraction fails on existing files because it can't overwrite them

Solutions:

Option 1: Fix cache path conflict (modify lines 37-43):

- name: Cache Go modules
  uses: actions/cache@v4
  with:
    path: |
      ~/.cache/go-build
      ~/go/pkg/mod
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    restore-keys: |
      ${{ runner.os }}-go-
  continue-on-error: true  # Prevent cache failures from breaking build

Option 2: Remove cache entirely (delete lines 37-43):
Since go mod download already handles dependencies efficiently and the cache creates conflicts, removing it would eliminate errors without significant performance impact.

I recommend Option 2 (removing the cache) for a clean, error-free workflow since the cache isn't providing meaningful benefits in this case.

Copilot finished work on behalf of go-while August 26, 2025 05:37
@go-while
Copy link
Owner

@copilot
Update the Build and Release workflow:
Remove Go cache module entirely (delete lines 37-43):
Since go mod download already handles dependencies efficiently and the cache creates conflicts, removing it would eliminate errors without significant performance impact.

…e extraction conflicts

Co-authored-by: go-while <137838162+go-while@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

@copilot
Update the Build and Release workflow:
Remove Go cache module entirely (delete lines 37-43):
...

Removed the Go cache module from the GitHub Actions workflow (lines 37-43) to eliminate the cache extraction conflicts. The go mod download step already handles dependencies efficiently, so removing the cache provides a cleaner error-free build process without performance impact.

Commit: 2671930

Copilot finished work on behalf of go-while August 26, 2025 05:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@go-while go-while requested a review from Copilot August 26, 2025 05:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates SHA256 checksum generation directly into the build workflow, making binary verification automatic and seamless across all release channels. The enhancement eliminates manual checksum steps and provides comprehensive verification options for users.

Key changes:

  • Automatic checksum generation integrated into standard build process via build_ALL.sh
  • Enhanced GitHub Actions workflow with platform-specific checksums and comprehensive verification files
  • Multiple verification workflows supporting local builds, platform-specific downloads, and archive-based verification

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
createChecksums.sh New script for generating SHA256 checksums with dual format support (full paths and archive-relative paths)
createUpdate.sh Enhanced to automatically generate checksums and include them in release archives
build_ALL.sh Modified to automatically call checksum generation after building all executables
README.md Added comprehensive documentation for build process, checksum generation, and verification workflows
.update Updated hash reflecting new release archive contents with included checksums
.github/workflows/release.yml Enhanced with platform-specific checksum generation, comprehensive SHA256SUMS.txt creation, and removed Go module cache
.github/copilot-instructions.md Updated project metadata including Go version, file counts, and new bridge integration features

@go-while go-while merged commit 5f1341c into testing-001 Aug 26, 2025
6 checks passed
@go-while go-while deleted the copilot/fix-16 branch August 26, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hash Sums per Binary File

2 participants