1- # This workflow is for building and pushing reproducible Docker images for releases.
21name : release-reproducible
32
43on :
87 workflow_dispatch :
98 inputs :
109 dry_run :
11- description : " Enable dry run mode (builds images but skips push to registry)"
10+ description : >-
11+ Enable dry run mode (builds images but skips push to registry)
1212 type : boolean
1313 default : false
1414
1515env :
16- DOCKER_REPRODUCIBLE_IMAGE_NAME : ${{ github.repository_owner }}/lighthouse-reproducible
16+ DOCKER_REPRODUCIBLE_IMAGE_NAME : >-
17+ ${{ github.repository_owner }}/lighthouse-reproducible
1718 DOCKER_PASSWORD : ${{ secrets.DH_KEY }}
1819 DOCKER_USERNAME : ${{ secrets.DH_ORG }}
1920
2324 runs-on : ubuntu-latest
2425 steps :
2526 - name : Extract version
26- run : echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
27+ run : >-
28+ echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
2729 id : extract_version
2830 outputs :
2931 VERSION : ${{ steps.extract_version.outputs.VERSION }}
@@ -38,42 +40,46 @@ jobs:
3840 include :
3941 - arch : amd64
4042 rust_target : x86_64-unknown-linux-gnu
41- rust_image : rust:1.86-bullseye@sha256:1110399f568f1dbe838e58f15b4162d899cb95f450f5f0ffa739614f3a4c32f1
43+ rust_image : >-
44+ rust:1.86-bullseye@sha256:1110399f568f1dbe838e58f15b4162d899cb95f450f5f0ffa739614f3a4c32f1
4245 platform : linux/amd64
4346 - arch : arm64
4447 rust_target : aarch64-unknown-linux-gnu
45- rust_image : rust:1.86-bullseye@sha256:36053eabadeb701e3e0406610a2ce72ccfa10b7828963cd08cffdcf660518b27
48+ rust_image : >-
49+ rust:1.86-bullseye@sha256:36053eabadeb701e3e0406610a2ce72ccfa10b7828963cd08cffdcf660518b27
4650 platform : linux/arm64
4751 steps :
4852 - uses : actions/checkout@v4
49-
53+
5054 - name : Set up Docker Buildx
5155 uses : docker/setup-buildx-action@v3
52-
56+
5357 - name : Log in to Docker Hub
5458 if : ${{ github.event.inputs.dry_run != 'true' }}
5559 uses : docker/login-action@v3
5660 with :
5761 username : ${{ env.DOCKER_USERNAME }}
5862 password : ${{ env.DOCKER_PASSWORD }}
59-
63+
6064 - name : Build reproducible image (${{ matrix.arch }})
6165 uses : docker/build-push-action@v6
66+ env :
67+ IMAGE_BASE : ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
68+ VERSION : ${{ needs.extract-version.outputs.VERSION }}
69+ ARCH : ${{ matrix.arch }}
70+ DOCKER_BUILD_RECORD_UPLOAD : false
6271 with :
6372 context : .
6473 file : ./Dockerfile.reproducible
6574 platforms : ${{ matrix.platform }}
6675 push : ${{ github.event.inputs.dry_run != 'true' }}
67- tags : |
68- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}:${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}
76+ tags : ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-${{ env.ARCH }}
6977 build-args : |
7078 RUST_TARGET=${{ matrix.rust_target }}
7179 RUST_IMAGE=${{ matrix.rust_image }}
7280 cache-from : type=gha,scope=${{ matrix.arch }}
7381 cache-to : type=gha,mode=max,scope=${{ matrix.arch }}
7482 provenance : false
75- env :
76- DOCKER_BUILD_RECORD_UPLOAD : false
7783
7884 create-manifest :
7985 name : create multi-arch manifest
@@ -86,24 +92,26 @@ jobs:
8692 with :
8793 username : ${{ env.DOCKER_USERNAME }}
8894 password : ${{ env.DOCKER_PASSWORD }}
89-
95+
9096 - name : Create and push multi-arch manifest
9197 run : |
98+ IMAGE_NAME=${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
99+ VERSION=${{ needs.extract-version.outputs.VERSION }}
92100 # Create manifest for version tag
93101 docker manifest create \
94- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } } \
95- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }-amd64 \
96- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }-arm64
97-
98- docker manifest push ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }
99-
102+ ${IMAGE_NAME} :${VERSION} \
103+ ${IMAGE_NAME} :${VERSION}-amd64 \
104+ ${IMAGE_NAME} :${VERSION}-arm64
105+
106+ docker manifest push ${IMAGE_NAME} :${VERSION}
107+
100108 # Create manifest for latest tag
101109 docker manifest create \
102- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME } }:latest \
103- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }-amd64 \
104- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }-arm64
105-
106- docker manifest push ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME } }:latest
110+ ${IMAGE_NAME }:latest \
111+ ${IMAGE_NAME} :${VERSION}-amd64 \
112+ ${IMAGE_NAME} :${VERSION}-arm64
113+
114+ docker manifest push ${IMAGE_NAME }:latest
107115
108116 dry-run-summary :
109117 name : dry run summary
@@ -113,19 +121,22 @@ jobs:
113121 steps :
114122 - name : Summarize dry run
115123 run : |
124+ IMAGE_NAME=${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
125+ VERSION=${{ needs.extract-version.outputs.VERSION }}
116126 echo "## 🧪 Reproducible Build Dry Run Summary"
117127 echo ""
118- echo "✅ Successfully completed dry run for version ${{ needs.extract-version.outputs. VERSION } }"
128+ echo "✅ Successfully completed dry run for version ${VERSION}"
119129 echo ""
120130 echo "### What would happen in a real release:"
121131 echo "- Multi-arch reproducible Docker images would be built"
122132 echo "- Images would be pushed to Docker Hub as:"
123- echo " - \`${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }} :${{ needs.extract-version.outputs. VERSION } }\`"
124- echo " - \`${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME } }:latest\`"
133+ echo " - \`${IMAGE_NAME} :${VERSION}\`"
134+ echo " - \`${IMAGE_NAME }:latest\`"
125135 echo ""
126136 echo "### Architectures built:"
127137 echo "- linux/amd64 (x86_64-unknown-linux-gnu)"
128138 echo "- linux/arm64 (aarch64-unknown-linux-gnu)"
129139 echo ""
130140 echo "### Next Steps"
131- echo "To perform a real release, push a git tag (e.g., \`git tag v4.6.0 && git push origin v4.6.0\`)"
141+ echo "To perform a real release, push a git tag"
142+ echo "(e.g., \`git tag v4.6.0 && git push origin v4.6.0\`)"
0 commit comments