fixup! Replace BBL with OpenSBI #131
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 | |
on: [push] | |
permissions: | |
id-token: write | |
packages: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve environment variables | |
run: make env >> $GITHUB_ENV | |
- name: Copy default Cartesi Linux config | |
run: make cartesi-linux-config | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/linux-kernel | |
docker.io/${{ github.repository_owner }}/linux-kernel,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v') }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download dependencies | |
run: make download | |
- name: Set up Depot CLI | |
uses: depot/setup-action@v1 | |
#TODO: change before merge -- gh release download -D dep/ -R ${{ github.repository_owner }}/riscv-pk v${{ env.RISCV_PK_VERSION }} --archive=tar.gz | |
- name: Download opensbi | |
run: > | |
wget https://github.com/cartesi/opensbi/archive/refs/heads/${{ env.OPENSBI_VERSION }}.tar.gz && mv ${{ env.OPENSBI_VERSION }}.tar.gz dep/opensbi-${{ env.OPENSBI_VERSION }}.tar.gz && ls -la dep | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} | |
- name: Build docker image | |
id: docker_build | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: cartesi/linux-kernel:devel | |
push: false | |
load: true | |
build-args: | | |
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }} | |
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }} | |
KERNEL_VERSION=${{ env.KERNEL_VERSION }} | |
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }} | |
OPENSBI_VERSION=${{ env.OPENSBI_VERSION }} | |
cache-from: type=gha,scope=regular | |
cache-to: type=gha,mode=max,scope=regular | |
project: ${{ vars.DEPOT_PROJECT }} | |
- name: Export linux.bin artifact | |
run: make copy | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: artifacts/* | |
# TODO: remove before merge | |
- name: Save kernel as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: linux-${{ env.KERNEL_VERSION }}.bin | |
path: linux-${{ env.KERNEL_VERSION }}.bin | |
- uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
prerelease: true | |
files: | | |
artifacts/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} | |
- name: Push docker image | |
id: docker_push | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
push: true | |
load: false | |
build-args: | | |
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }} | |
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }} | |
KERNEL_VERSION=${{ env.KERNEL_VERSION }} | |
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }} | |
OPENSBI_VERSION=${{ env.OPENSBI_VERSION }} | |
cache-from: type=gha,scope=regular | |
cache-to: type=gha,mode=max,scope=regular | |
project: ${{ vars.DEPOT_PROJECT }} |