Skip to content

Commit

Permalink
feat!: Update toolchain version to v0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vfusco committed Aug 14, 2023
1 parent 22aa782 commit 7c12f36
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: Build
on: [push]
<<<<<<< HEAD
=======
env:
KERNEL_VERSION: 5.15.63-ctsi-2
RISCV_PK_VERSION: 1.0.0-ctsi-1
TOOLCHAIN_REPOSITORY: cartesi/toolchain
TOOLCHAIN_VERSION: 0.15.0
>>>>>>> cc77330 (feat!: Update toolchain version to v0.15.0)
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
<<<<<<< HEAD

- name: Retrieve environment variables
run: make env >> $GITHUB_ENV
Expand All @@ -14,6 +23,8 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
=======
>>>>>>> cc77330 (feat!: Update toolchain version to v0.15.0)

- name: Set up Docker Buildx
id: buildx
Expand All @@ -23,20 +34,39 @@ jobs:
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_ORGANIZATION }}/linux-kernel
images: ${{ github.repository_owner }}/linux-kernel
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
<<<<<<< HEAD
- name: Login to GHCR
=======
- name: Login to Docker Hub
>>>>>>> cc77330 (feat!: Update toolchain version to v0.15.0)
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

<<<<<<< HEAD
- name: Download dependencies
run: make download
=======
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download linux and riscv-pk
run: make checksum

- name: Copy default Cartesi Linux config
run: make cartesi-linux-config
>>>>>>> cc77330 (feat!: Update toolchain version to v0.15.0)

- name: Build docker image
id: docker_build
Expand All @@ -49,13 +79,13 @@ jobs:
push: false
load: true
build-args: |
TOOLCHAIN_REPOSITORY=${{ secrets.DOCKER_ORGANIZATION }}/toolchain
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }}
RISCV_PK_VERSION=${{ env.RISCV_PK_VERSION }}
cache-from: type=gha,mode=xmax,scope=regular
cache-to: type=gha,scope=regular
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular

- name: Export artifacts
run: make copy IMG=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs`
Expand Down Expand Up @@ -86,10 +116,10 @@ jobs:
push: true
load: false
build-args: |
TOOLCHAIN_REPOSITORY=${{ secrets.DOCKER_ORGANIZATION }}/toolchain
TOOLCHAIN_REPOSITORY=${{ env.TOOLCHAIN_REPOSITORY }}
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }}
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }}
RISCV_PK_VERSION=${{ env.RISCV_PK_VERSION }}
cache-from: type=gha,mode=max,scope=regular
cache-to: type=gha,scope=regular
cache-from: type=gha,scope=regular
cache-to: type=gha,mode=max,scope=regular
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ PATCH := 0
LABEL :=
IMAGE_KERNEL_VERSION?= $(MAJOR).$(MINOR).$(PATCH)$(LABEL)

UNAME:=$(shell uname)

TAG ?= devel
TOOLCHAIN_DOCKER_REPOSITORY ?= cartesi/toolchain
TOOLCHAIN_TAG ?= 0.13.0
KERNEL_TIMESTAMP ?= $(shell date -Rud @$(shell git log -1 --format=%ct 2> /dev/null || date +%s))
TOOLCHAIN_REPOSITORY ?= cartesi/toolchain
TOOLCHAIN_TAG ?= 0.15.0
KERNEL_VERSION ?= 5.15.63-ctsi-2
KERNEL_SRCPATH := linux-$(KERNEL_VERSION).tar.gz
RISCV_PK_VERSION ?= 1.0.0-ctsi-1
Expand All @@ -37,14 +38,20 @@ CONTAINER_BASE := /opt/cartesi/kernel
IMG ?= cartesi/linux-kernel:$(TAG)
BASE:=/opt/riscv

ifeq ($(UNAME),Darwin)
KERNEL_TIMESTAMP ?= $(shell date -r $(shell git log -1 --format=%ct 2> /dev/null || date +%s) +"%a, %d %b %Y %H:%M:%S +0000")
else
KERNEL_TIMESTAMP ?= $(shell date -Rud @$(shell git log -1 --format=%ct 2> /dev/null || date +%s))
endif

BUILD_ARGS :=

ifneq ($(IMAGE_KERNEL_VERSION),)
BUILD_ARGS += --build-arg IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION)
endif

ifneq ($(TOOLCHAIN_DOCKER_REPOSITORY),)
BUILD_ARGS += --build-arg TOOLCHAIN_REPOSITORY=$(TOOLCHAIN_DOCKER_REPOSITORY)
ifneq ($(TOOLCHAIN_REPOSITORY),)
BUILD_ARGS += --build-arg TOOLCHAIN_REPOSITORY=$(TOOLCHAIN_REPOSITORY)
endif

ifneq ($(TOOLCHAIN_TAG),)
Expand Down Expand Up @@ -97,6 +104,7 @@ env:
@echo KERNEL_VERSION="$(KERNEL_VERSION)"
@echo IMAGE_KERNEL_VERSION="$(IMAGE_KERNEL_VERSION)"
@echo RISCV_PK_VERSION="$(RISCV_PK_VERSION)"
@echo TOOLCHAIN_REPOSITORY="$(TOOLCHAIN_REPOSITORY)"
@echo TOOLCHAIN_VERSION="$(TOOLCHAIN_TAG)"
@make -srf build.mk KERNEL_VERSION=$(KERNEL_VERSION) IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION) env
copy:
Expand Down

0 comments on commit 7c12f36

Please sign in to comment.