Skip to content

Commit c4bfdf6

Browse files
committed
make reproducibility mandatory
1 parent 3494cbb commit c4bfdf6

File tree

2 files changed

+60
-31
lines changed

2 files changed

+60
-31
lines changed

.github/workflows/checks.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,33 @@ jobs:
8080
go mod tidy
8181
git update-index -q --really-refresh
8282
git diff-index HEAD
83+
84+
reproducibility-test:
85+
name: Test Reproducible Builds
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0
92+
93+
- name: Set up Go
94+
uses: actions/setup-go@v5
95+
with:
96+
go-version: '1.24'
97+
cache: true
98+
99+
- name: Set SOURCE_DATE_EPOCH for reproducible builds
100+
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
101+
102+
- name: Test reproducible builds
103+
run: |
104+
# Install GoReleaser
105+
go install github.com/goreleaser/goreleaser/v2@latest
106+
107+
# Run reproducibility test
108+
make package-test-reproducible
109+
110+
echo "✅ Reproducibility test passed"
111+
env:
112+
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}

.github/workflows/release.yaml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,38 @@ permissions:
1010
packages: write
1111

1212
jobs:
13+
reproducibility-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24'
25+
cache: true
26+
27+
- name: Set SOURCE_DATE_EPOCH for reproducible builds
28+
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
29+
30+
- name: Test reproducible builds
31+
run: |
32+
# Install GoReleaser
33+
go install github.com/goreleaser/goreleaser/v2@latest
34+
35+
# Run reproducibility test
36+
make package-test-reproducible
37+
38+
echo "✅ Reproducibility test passed"
39+
env:
40+
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}
41+
1342
release:
1443
runs-on: ubuntu-latest
44+
needs: reproducibility-test # Only run if reproducibility test passes
1545
steps:
1646
- name: Checkout
1747
uses: actions/checkout@v4
@@ -102,34 +132,3 @@ jobs:
102132
echo "❌ No AMD64 .deb file found for testing"
103133
exit 1
104134
fi
105-
106-
reproducibility-test:
107-
runs-on: ubuntu-latest
108-
needs: release
109-
if: always()
110-
steps:
111-
- name: Checkout
112-
uses: actions/checkout@v4
113-
with:
114-
fetch-depth: 0
115-
116-
- name: Set up Go
117-
uses: actions/setup-go@v5
118-
with:
119-
go-version: '1.24'
120-
cache: true
121-
122-
- name: Set SOURCE_DATE_EPOCH for reproducible builds
123-
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
124-
125-
- name: Test reproducible builds
126-
run: |
127-
# Install GoReleaser
128-
go install github.com/goreleaser/goreleaser/v2@latest
129-
130-
# Run reproducibility test
131-
make package-test-reproducible
132-
133-
echo "✅ Reproducibility test passed"
134-
env:
135-
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}

0 commit comments

Comments
 (0)