Bake Image #78
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: Bake Image | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
jobs: | |
info: | |
name: Build information | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.step1.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: extractions/setup-just@v1 | |
- id: step1 | |
name: Get Version | |
run: | | |
case "${GITHUB_REF}" in | |
refs/tags/*) | |
version="${GITHUB_REF#refs/*/}" | |
echo "Using version from tag: $version" | |
;; | |
*) | |
version="$(just generate_version)" | |
echo "Using version from timestamp: $version" | |
;; | |
esac | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
bake-image: | |
name: Bake Image ${{ matrix.job.arch }} - ${{ matrix.job.profile }} - ${{ matrix.job.variant }} | |
runs-on: ubuntu-latest | |
needs: info | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { arch: armhf, profile: armhf, variant: pi01 } | |
- { arch: arm64, profile: default, variant: pi023 } | |
- { arch: arm64, profile: default, variant: pi4 } | |
- { arch: arm64, profile: default, variant: pi45 } | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: extractions/setup-just@v1 | |
- name: Build image | |
env: | |
VERSION: ${{needs.info.outputs.version}} | |
run: | | |
mkdir build | |
just IMAGE_ARCH=${{ matrix.job.arch }} PROFILE=${{ matrix.job.profile }} VARIANT=${{ matrix.job.variant }} build-all | |
mv recipes/sbom/debian-packages.list build/tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{needs.info.outputs.version}}.sbom.txt | |
- name: Upload Image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{needs.info.outputs.version}} | |
path: | | |
build/tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{needs.info.outputs.version}}*.xz | |
build/tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{needs.info.outputs.version}}.sbom.txt | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- info | |
- bake-image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: release | |
- name: Show release artifacts | |
run: ls -l release/*/* | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
generate_release_notes: true | |
draft: true | |
files: | | |
./release/*/* |