Bump the all-deps group with 7 updates (#893) #226
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| release: | |
| types: | |
| - 'published' | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| strategy: | |
| matrix: | |
| binary: ["fsck", "tesseract/aws", "tesseract/gcp", "tesseract/posix"] | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| path: tesseract | |
| - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version-file: tesseract/go.mod | |
| cache-dependency-path: tesseract/go.sum | |
| - name: Install ko | |
| uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.9.0 | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 | |
| - name: Login to GHCR | |
| uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and publish image | |
| id: build | |
| run: | | |
| export KO_DOCKER_REPO="ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]' )" | |
| mkdir -p ${GITHUB_WORKSPACE}/sbom-output | |
| cd ${GITHUB_WORKSPACE}/tesseract | |
| tags="latest,${{ github.sha }}" | |
| if [ "${GITHUB_EVENT_RELEASE_TAG_NAME}" != "" ]; then | |
| tags="${tags},${GITHUB_EVENT_RELEASE_TAG_NAME}" | |
| fi | |
| image_and_digest=$(ko publish \ | |
| --base-import-paths \ | |
| --platform=linux/amd64,linux/arm64 \ | |
| --tags=${tags} \ | |
| --sbom-dir=${GITHUB_WORKSPACE}/sbom-output \ | |
| github.com/transparency-dev/tesseract/cmd/${BINARY}) | |
| echo "Images: ${image}" | |
| echo "SBOM files:" | |
| ls -la ${GITHUB_WORKSPACE}/sbom-output/ | |
| image=$(echo "${image_and_digest}" | cut -d'@' -f1) | |
| digest=$(echo "${image_and_digest}" | cut -d'@' -f2) | |
| echo "image=${image}" >> "${GITHUB_OUTPUT}" | |
| echo "digest=${digest}" >> "${GITHUB_OUTPUT}" | |
| env: | |
| BINARY: ${{ matrix.binary }} | |
| GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-name: ${{ steps.build.outputs.image }} | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| push-to-registry: true | |
| - name: Sign images | |
| run: | | |
| cosign sign --yes --recursive "${IMAGE}@${DIGEST}" | |
| env: | |
| IMAGE: ${{ steps.build.outputs.image }} | |
| DIGEST: ${{ steps.build.outputs.digest }} | |
| - name: Attest SBOMs | |
| run: | | |
| sbom="${GITHUB_WORKSPACE}/sbom-output/${BINARY##*/}-index.spdx.json" | |
| cosign attest --yes --predicate "${sbom}" --type spdxjson "${IMAGE}@${DIGEST}" | |
| env: | |
| BINARY: ${{ matrix.binary }} | |
| IMAGE: ${{ steps.build.outputs.image }} | |
| DIGEST: ${{ steps.build.outputs.digest }} | |