Test GitHub Attest #26
Workflow file for this run
This file contains 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: Build and sign image | |
on: | |
push: | |
tags: | |
- v* | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
attestations: write | |
jobs: | |
build_and_sign_image: | |
name: Build and sign image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Build EIF | |
id: build-eif | |
uses: richardfan1126/nitro-enclaves-eif-build-action@beta-github-attest | |
with: | |
docker-build-context-path: enclave | |
enable-ghcr-push: true | |
enable-artifact-sign: true | |
enable-github-attest: true | |
eif-file-name: enclave.eif | |
eif-info-file-name: enclave-info.json | |
artifact-tag: ${{ github.sha }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print outputs | |
env: | |
EIF_FILE_PATH: ${{ steps.build-eif.outputs.eif-file-path }} | |
EIF_INFO_PATH: ${{ steps.build-eif.outputs.eif-info-path }} | |
GHCR_ARTIFACT_DIGEST: ${{ steps.build-eif.outputs.ghcr-artifact-digest }} | |
GHCR_ARTIFACT_PATH: ${{ steps.build-eif.outputs.ghcr-artifact-path }} | |
REKOR_LOG_INDEX: ${{ steps.build-eif.outputs.rekor-log-index }} | |
run: | | |
echo "${EIF_FILE_PATH}" | |
echo "${EIF_INFO_PATH}" | |
echo "${GHCR_ARTIFACT_DIGEST}" | |
echo "${GHCR_ARTIFACT_PATH}" | |
echo "${REKOR_LOG_INDEX}" | |
- name: Generate release note | |
id: generate-release-note | |
env: | |
EIF_INFO_PATH: ${{ steps.build-eif.outputs.eif-info-path }} | |
REKOR_LOG_INDEX: ${{ steps.build-eif.outputs.rekor-log-index }} | |
run: | | |
# Get EIF measurement | |
EIF_MEASUREMENT=$(cat ${EIF_INFO_PATH} | jq '.Measurements') | |
REKOR_SEARCH_LINK="https://search.sigstore.dev/?logIndex=${REKOR_LOG_INDEX}" | |
RELEASE_NOTE=$(cat << EOF | |
EIF measurements: | |
\`\`\` | |
${EIF_MEASUREMENT} | |
\`\`\` | |
Signing entry: [${REKOR_SEARCH_LINK}](${REKOR_SEARCH_LINK}) | |
EOF | |
) | |
echo "RELEASE_NOTE<<EOF" >> "$GITHUB_OUTPUT" | |
echo "${RELEASE_NOTE}" >> "$GITHUB_OUTPUT" | |
echo "EOF" >> "$GITHUB_OUTPUT" | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ${{ steps.build-eif.outputs.eif-file-path }} | |
body: ${{ steps.generate-release-note.outputs.RELEASE_NOTE }} |