···1515 uses: robinraju/release-downloader@v1
1616 with:
1717 releaseId: "${{ inputs.release-id }}"
1818- fileName: "gleam-${{ inputs.version }}-{x86_64-unknown-linux-musl,aarch64-unknown-linux-musl}.tar.gz"
1818+ fileName: "gleam-${{ inputs.version }}-{x86_64-unknown-linux-musl,aarch64-unknown-linux-musl}.*"
19192020 - name: "Unpack release files into correct location"
2121 shell: bash
···32323333 # Move files into place
3434 mv gleam "gleam-$SHORT"
3535+3636+ # The SBoM is added to the images so that the Docker Scout Scanner is
3737+ # able to find the info about the gleam binary since it was not
3838+ # installed by the operating system package manager.
3939+ mv "gleam-$VERSION-$LONG.tar.gz.sbom.spdx.json" "gleam-$SHORT.sbom.spdx.json"
35403641 # Delete Unused Files
3742 rm -rf "gleam-$VERSION-$LONG*"
···7479 platforms: linux/amd64,linux/arm64
7580 file: containers/${{ matrix.base-image }}.dockerfile
7681 push: true
8282+8383+ # Enabling `provenance` will cause the action to create SLSA build
8484+ # provenance and push it alongside the tagged image. In practical terms,
8585+ # we're adding info to the tag that attests to where, when, and how the
8686+ # asset and image was built.
8787+ #
8888+ # For more info on Docker Attestations, see:
8989+ # https://docs.docker.com/build/ci/github-actions/attestations/
9090+ provenance: true
9191+9292+ # Enabling `sbom` will trigger an SBoM Scan using Docker Scout:
9393+ # https://docs.docker.com/scout/how-tos/view-create-sboms/
9494+ # The scan will detect any operating system packages as well as the Gleam
9595+ # Build SBoM added into the Docker Container.
9696+ #
9797+ # Why is this helpful?
9898+ # * If you build services on top of these container images, you can track
9999+ # all dependencies that ship with Gleam, plus the rest of your stack in
100100+ # the image.
101101+ # * This makes it easier to do image-level vulnerability scans and
102102+ # compliance checks.
103103+ #
104104+ # For more info on Docker SBoMs, see:
105105+ # https://docs.docker.com/build/metadata/attestations/sbom/
106106+ sbom: true
77107 tags: ${{ steps.versions.outputs.container-tag }}
78108 labels: |
79109 org.opencontainers.image.title=gleam
+71
.github/actions/build-release/action.yml
···2828 ${{ steps.build.outputs.archive }}
2929 ${{ steps.build.outputs.archive }}.sha256
3030 ${{ steps.build.outputs.archive }}.sha512
3131+ ${{ steps.build.outputs.archive }}.sigstore
3232+ ${{ steps.build.outputs.archive }}.sbom.spdx.json
3333+ ${{ steps.build.outputs.archive }}.sbom.cyclonedx.json
31343235runs:
3336 using: "composite"
···3841 toolchain: ${{ inputs.toolchain }}
3942 target: ${{ inputs.target }}
4043 cache-key: v1-${{ inputs.target }}
4444+4545+ - name: Install Cargo SBoM
4646+ shell: bash
4747+ # The `cargo-sbom` version is specified in the next line. Change it to
4848+ # keep it up-to-date.
4949+ run: cargo install cargo-sbom@~0.9.1
41504251 - name: Build WASM release binary
4352 if: ${{ inputs.target != 'wasm32-unknown-unknown' }}
···124133 TARGET: "${{ inputs.target }}"
125134 ARCHIVE: "${{ steps.build.outputs.archive }}"
126135136136+ # By using `cargo-sbom``, we create two formats of Build SBoMs
137137+ # (SPDX and CycloneDX) for the gleam build.
138138+ # We store those files alongside the build artifacts on the GitHub Release
139139+ # page and also use them to create Container SBoMs for Docker images.
140140+ #
141141+ # Why is this helpful?
142142+ # * It gives us and our users complete visibility into which dependencies
143143+ # and which versions are present in the build / container image.
144144+ # * The SBoM can be fed into vulnerability scanners so that anyone can check
145145+ # if any dependencies have known security issues.
146146+ - name: Generate Build SBoM
147147+ shell: bash
148148+ run: |
149149+ cargo-sbom \
150150+ --output-format spdx_json_2_3 \
151151+ > "$ARCHIVE.sbom.spdx.json"
152152+153153+ cargo-sbom \
154154+ --output-format cyclone_dx_json_1_4 \
155155+ > "$ARCHIVE.sbom.cyclonedx.json"
156156+ env:
157157+ ARCHIVE: "${{ steps.build.outputs.archive }}"
158158+127159 - name: Hash Build Archive
128160 shell: bash
129161 run: |
···132164 env:
133165 ARCHIVE: "${{ steps.build.outputs.archive }}"
134166167167+ # We provide SLSA Provenance for the distribution build. This attests to
168168+ # where, when, and how the asset or image was built.
169169+ #
170170+ # Why is this helpful?
171171+ # * It provides a record of the exact Git commit (git sha) and GitHub
172172+ # Actions workflow used to produce a release.
173173+ # * Users or automated systems can verify that the artifact you’re
174174+ # downloading was indeed built from the official Gleam repo, on a
175175+ # particular date, using the correct pipeline and not tampered with later.
176176+ # * The attestation is published to a transparency log for extra
177177+ # verification: https://github.com/gleam-lang/gleam/attestations/
178178+ #
179179+ # For more information, see:
180180+ # * https://github.com/actions/attest
181181+ # * https://github.com/actions/attest-sbom
182182+ - name: Attest Distribution Assets with SBoM
183183+ id: attest-sbom
184184+ uses: actions/attest-sbom@v2
185185+ with:
186186+ subject-path: |
187187+ ${{ steps.build.outputs.archive }}
188188+ ${{ steps.build.outputs.archive }}.sbom.spdx.json
189189+ ${{ steps.build.outputs.archive }}.sbom.cyclonedx.json
190190+ sbom-path: "${{ steps.build.outputs.archive }}.sbom.spdx.json"
191191+192192+ # The provenanve information is stored alongside the built artifact with
193193+ # the `.sigstore` file extension.
194194+ - name: "Copy SBoM provenance"
195195+ id: sbom-provenance
196196+ shell: bash
197197+ run: |
198198+ cp "$ATTESTATION" "$ARCHIVE.sigstore"
199199+ env:
200200+ ARCHIVE: "${{ steps.build.outputs.archive }}"
201201+ ATTESTATION: "${{ steps.attest-sbom.outputs.bundle-path }}"
202202+135203 - name: Upload artifact
136204 uses: actions/upload-artifact@v4
137205 with:
···140208 ${{ steps.build.outputs.archive }}
141209 ${{ steps.build.outputs.archive }}.sha256
142210 ${{ steps.build.outputs.archive }}.sha512
211211+ ${{ steps.build.outputs.archive }}.sigstore
212212+ ${{ steps.build.outputs.archive }}.sbom.spdx.json
213213+ ${{ steps.build.outputs.archive }}.sbom.cyclonedx.json
143214 overwrite: true