Update Linux build scripts #4
Workflow file for this run
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: Build Linux and openSBI in os-boot | |
permissions: | |
id-token: write | |
attestations: write | |
contents: read | |
on: | |
push: | |
paths: | |
- ".github/workflows/linux.yml" | |
- "os-boot/linux/**" | |
- "!os-boot/**.md" | |
pull_request: | |
paths: | |
- ".github/workflows/linux.yml" | |
- "os-boot/linux/**" | |
- "!os-boot/**.md" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install packages | |
run: sudo apt install -y build-essential curl | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Cache Sources | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('os-boot/linux/Makefile') }} | |
path: os-boot/linux/src/*.tar.xz | |
- name: Make ELF | |
working-directory: os-boot/linux | |
run: make -j$(nproc) | |
- name: Upload ELF | |
uses: actions/upload-artifact@v4 | |
id: upload | |
with: | |
name: os-boot-${{ github.run_id }} | |
path: os-boot/linux/build/fw_payload.elf | |
- name: Generate Artifact Attestation | |
if: github.event_name != 'pull_request' | |
uses: actions/attest-build-provenance@v2 | |
id: attest | |
with: | |
subject-path: os-boot/linux/build/fw_payload.elf | |
show-summary: false | |
- name: Upload Paper Work | |
working-directory: os-boot | |
env: | |
ELFURL: ${{ steps.upload.outputs.artifact-url }} | |
ATTESTURL: ${{ steps.attest.outputs.attestation-url }} | |
run: | | |
echo "# os-boot ELF" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "The generated [ELF file]("$ELFURL") can be verified from [here]("$ATTESTURL")." >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "## Header" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
readelf -h linux/build/fw_payload.elf >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY |