1- # This workflow is for building and pushing reproducible Docker images for releases.
1+ ---
2+ # This workflow is for building and pushing reproducible Docker images
3+ # for releases.
24name : release-reproducible
35
46on :
810 workflow_dispatch :
911 inputs :
1012 dry_run :
11- description : " Enable dry run mode (builds images but skips push to registry)"
13+ description : >-
14+ Enable dry run mode (builds images but skips push to registry)
1215 type : boolean
1316 default : false
1417
1518env :
16- DOCKER_REPRODUCIBLE_IMAGE_NAME : ${{ github.repository_owner }}/lighthouse-reproducible
19+ DOCKER_REPRODUCIBLE_IMAGE_NAME : >-
20+ ${{ github.repository_owner }}/lighthouse-reproducible
1721 DOCKER_PASSWORD : ${{ secrets.DH_KEY }}
1822 DOCKER_USERNAME : ${{ secrets.DH_ORG }}
1923
2327 runs-on : ubuntu-latest
2428 steps :
2529 - name : Extract version
26- run : echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
30+ run : >-
31+ echo "VERSION=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
2732 id : extract_version
2833 outputs :
2934 VERSION : ${{ steps.extract_version.outputs.VERSION }}
@@ -38,42 +43,46 @@ jobs:
3843 include :
3944 - arch : amd64
4045 rust_target : x86_64-unknown-linux-gnu
41- rust_image : rust:1.86-bullseye@sha256:1110399f568f1dbe838e58f15b4162d899cb95f450f5f0ffa739614f3a4c32f1
46+ rust_image : >-
47+ rust:1.86-bullseye@sha256:1110399f568f1dbe838e58f15b4162d899cb95f450f5f0ffa739614f3a4c32f1
4248 platform : linux/amd64
4349 - arch : arm64
4450 rust_target : aarch64-unknown-linux-gnu
45- rust_image : rust:1.86-bullseye@sha256:36053eabadeb701e3e0406610a2ce72ccfa10b7828963cd08cffdcf660518b27
51+ rust_image : >-
52+ rust:1.86-bullseye@sha256:36053eabadeb701e3e0406610a2ce72ccfa10b7828963cd08cffdcf660518b27
4653 platform : linux/arm64
4754 steps :
4855 - uses : actions/checkout@v4
49-
56+
5057 - name : Set up Docker Buildx
5158 uses : docker/setup-buildx-action@v3
52-
59+
5360 - name : Log in to Docker Hub
5461 if : ${{ github.event.inputs.dry_run != 'true' }}
5562 uses : docker/login-action@v3
5663 with :
5764 username : ${{ env.DOCKER_USERNAME }}
5865 password : ${{ env.DOCKER_PASSWORD }}
59-
66+
6067 - name : Build reproducible image (${{ matrix.arch }})
6168 uses : docker/build-push-action@v6
69+ env :
70+ IMAGE_BASE : ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
71+ VERSION : ${{ needs.extract-version.outputs.VERSION }}
72+ ARCH : ${{ matrix.arch }}
73+ DOCKER_BUILD_RECORD_UPLOAD : false
6274 with :
6375 context : .
6476 file : ./Dockerfile.reproducible
6577 platforms : ${{ matrix.platform }}
6678 push : ${{ github.event.inputs.dry_run != 'true' }}
67- tags : |
68- ${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}:${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}
79+ tags : ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-${{ env.ARCH }}
6980 build-args : |
7081 RUST_TARGET=${{ matrix.rust_target }}
7182 RUST_IMAGE=${{ matrix.rust_image }}
7283 cache-from : type=gha,scope=${{ matrix.arch }}
7384 cache-to : type=gha,mode=max,scope=${{ matrix.arch }}
7485 provenance : false
75- env :
76- DOCKER_BUILD_RECORD_UPLOAD : false
7786
7887 create-manifest :
7988 name : create multi-arch manifest
@@ -86,24 +95,26 @@ jobs:
8695 with :
8796 username : ${{ env.DOCKER_USERNAME }}
8897 password : ${{ env.DOCKER_PASSWORD }}
89-
98+
9099 - name : Create and push multi-arch manifest
91100 run : |
101+ IMAGE_NAME=${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
102+ VERSION=${{ needs.extract-version.outputs.VERSION }}
92103 # Create manifest for version tag
93104 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-
105+ ${IMAGE_NAME} :${VERSION} \
106+ ${IMAGE_NAME} :${VERSION}-amd64 \
107+ ${IMAGE_NAME} :${VERSION}-arm64
108+
109+ docker manifest push ${IMAGE_NAME} :${VERSION}
110+
100111 # Create manifest for latest tag
101112 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
113+ ${IMAGE_NAME }:latest \
114+ ${IMAGE_NAME} :${VERSION}-amd64 \
115+ ${IMAGE_NAME} :${VERSION}-arm64
116+
117+ docker manifest push ${IMAGE_NAME }:latest
107118
108119 dry-run-summary :
109120 name : dry run summary
@@ -113,19 +124,22 @@ jobs:
113124 steps :
114125 - name : Summarize dry run
115126 run : |
127+ IMAGE_NAME=${{ env.DOCKER_REPRODUCIBLE_IMAGE_NAME }}
128+ VERSION=${{ needs.extract-version.outputs.VERSION }}
116129 echo "## 🧪 Reproducible Build Dry Run Summary"
117130 echo ""
118- echo "✅ Successfully completed dry run for version ${{ needs.extract-version.outputs. VERSION } }"
131+ echo "✅ Successfully completed dry run for version ${VERSION}"
119132 echo ""
120133 echo "### What would happen in a real release:"
121134 echo "- Multi-arch reproducible Docker images would be built"
122135 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\`"
136+ echo " - \`${IMAGE_NAME} :${VERSION}\`"
137+ echo " - \`${IMAGE_NAME }:latest\`"
125138 echo ""
126139 echo "### Architectures built:"
127140 echo "- linux/amd64 (x86_64-unknown-linux-gnu)"
128141 echo "- linux/arm64 (aarch64-unknown-linux-gnu)"
129142 echo ""
130143 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\`)"
144+ echo "To perform a real release, push a git tag"
145+ echo "(e.g., \`git tag v4.6.0 && git push origin v4.6.0\`)"
0 commit comments