Skip to content

Use default value for github-token #25

Use default value for github-token

Use default value for github-token #25

---
name: Build and sign image
on:
push:
tags:
- v*
permissions:
contents: write
packages: write
id-token: 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@dev
with:
docker-build-context-path: enclave
enable-ghcr-push: true
enable-artifact-sign: true
eif-file-name: enclave.eif
eif-info-file-name: enclave-info.json
artifact-tag: ${{ github.sha }}
- 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 }}