@@ -68,14 +68,14 @@ jobs:
6868 # Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects
6969 # =============================================================================================================
7070
71- build-image :
71+ build-linux- image :
7272 permissions :
7373 contents : read
7474 packages : write
7575 needs : args
7676 outputs :
7777 image : ${{ steps.image.outputs.image }}
78- digest : ${{ steps.build .outputs.digest }}
78+ digest : ${{ steps.image .outputs.digest }}
7979 runs-on : ubuntu-latest
8080 steps :
8181 - name : Checkout the repository
@@ -101,6 +101,7 @@ jobs:
101101 uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
102102 id : build
103103 with :
104+ platforms : linux/amd64,linux/arm64
104105 push : true
105106 tags : ${{ steps.meta.outputs.tags }}
106107 labels : ${{ steps.meta.outputs.labels }}
@@ -109,25 +110,64 @@ jobs:
109110 GIT_COMMIT=${{ needs.args.outputs.commit }}
110111 BUILD_DATE=${{ needs.args.outputs.commit-date }}
111112 GIT_TREE_STATE=${{ needs.args.outputs.tree-state }}
113+
112114 - name : Output image
113115 id : image
114116 run : |
115117 # NOTE: Set the image as an output because the `env` context is not
116118 # available to the inputs of a reusable workflow call.
117119 image_name=$(echo "${IMAGE_REGISTRY}/${IMAGE_NAME}"| tr '[:upper:]' '[:lower:]')
118120 echo "image=$image_name" >> "$GITHUB_OUTPUT"
121+
122+ build-windows-image :
123+ permissions :
124+ contents : read
125+ packages : write
126+ needs : args
127+ runs-on : windows-latest
128+ steps :
129+ - name : Checkout the repository
130+ uses : actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v2.3.4
131+
132+ - name : Authenticate Docker
133+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
134+ with :
135+ registry : ${{ env.IMAGE_REGISTRY }}
136+ username : ${{ github.actor }}
137+ password : ${{ secrets.GITHUB_TOKEN }}
138+
139+ - name : Extract metadata (tags, labels) for Docker
140+ id : meta
141+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
142+ with :
143+ images : ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
144+
145+ - name : Build and push Windows Docker image
146+ uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
147+ with :
148+ platforms : windows/amd64
149+ push : true
150+ tags : ${{ steps.meta.outputs.tags }}
151+ labels : ${{ steps.meta.outputs.labels }}
152+ file : ./Dockerfile.windows
153+ build-args : |
154+ VERSION=${{ needs.args.outputs.version }}
155+ GIT_COMMIT=${{ needs.args.outputs.commit }}
156+ BUILD_DATE=${{ needs.args.outputs.commit-date }}
157+ GIT_TREE_STATE=${{ needs.args.outputs.tree-state }}
158+
119159 # This step calls the container workflow to generate provenance and push it to
120160 # the container registry.
121161 provenance :
122- needs : build-image
162+ needs : build-linux- image
123163 permissions :
124164 actions : read # for detecting the Github Actions environment.
125165 id-token : write # for creating OIDC tokens for signing.
126166 packages : write # for uploading attestations.
127167 uses : slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
128168 with :
129- image : ${{ needs.build-image.outputs.image }}
130- digest : ${{ needs.build-image.outputs.digest }}
169+ image : ${{ needs.build-linux- image.outputs.image }}
170+ digest : ${{ needs.build-linux- image.outputs.digest }}
131171 registry-username : ${{ github.actor }}
132172 private-repository : true
133173 secrets :
0 commit comments