Skip to content

Commit

Permalink
Epikichi/edge 904 investigate and add reproducable build (#928)
Browse files Browse the repository at this point in the history
* adding reproducable build step after build

* fixing lint

* removing trigger restrictions

* testing with awk'd statement

* missing variable

* adding additional flags for insurance

* removing block potential
  • Loading branch information
epikichi authored Nov 18, 2022
1 parent 3c8ccd7 commit 5250168
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,34 @@ jobs:
name: polygon-edge
path: polygon-edge.tar.gz
retention-days: 3

go_build_reproducibility:
name: Verify Build Reproducibility
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go environment
uses: actions/setup-go@v3.3.0
with:
go-version: 1.18.x

- name: 'Reproduce builds'
continue-on-error: true
run: |
go build -o ./edge-1 -trimpath -buildvcs=false
go build -o ./edge-2 -trimpath -buildvcs=false
buildsha1=$(shasum -a256 ./edge-1 | awk '{print $1}')
buildsha2=$(shasum -a256 ./edge-2 | awk '{print $1}')
echo "Build 1 SHA: $buildsha1"
echo "Build 2 SHA: $buildsha2"
if [ "$buildsha1" != "$buildsha2" ]; then
echo "Build artifact does not match original"
exit 1
else
echo "Build artifact matches original"
fi
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Pull Request CI
on: # yamllint disable-line rule:truthy
workflow_dispatch: {}
pull_request:
paths:
- '**.go'

jobs:
build:
Expand Down

0 comments on commit 5250168

Please sign in to comment.