Update emulator tools to v0.12.0 #34
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] | |
env: | |
TOOLCHAIN_VERSION: feature-bump-gcc | |
CACHE_DIR: /home/runner/work/image-rootfs/image-rootfs/cache | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
services: | |
nginx: | |
image: nginx | |
ports: | |
- 8080:80 | |
volumes: | |
- /home/runner/work/cache:/usr/share/nginx/html | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # fetch tags | |
- name: Copy default Buildroot and Busybox config | |
run: make init-config | |
- name: Resolve rootfs filename from Makefile | |
run: echo ROOTFS_FILENAME="$(make rootfs-filename)" >> $GITHUB_ENV | |
- name: Setup primary site | |
run: sed -i -e 's#BR2_PRIMARY_SITE=""#BR2_PRIMARY_SITE="http://172.17.0.1:8080"#' cartesi-buildroot-config | |
- name: Setup download cache | |
id: buildroot-cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-buildroot-cache-files | |
path: ${{ env.CACHE_DIR }} | |
restore-keys: ${{ runner.os }}-buildroot-cache-files | |
- name: Copy GitHub cache to nginx cache folder | |
run: if [ -d ${{ env.CACHE_DIR }} ]; then sudo mv ${{ env.CACHE_DIR }}/* /home/runner/work/cache; fi | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ secrets.DOCKER_ORGANIZATION }}/rootfs | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Create distribution details | |
run: make os-release | |
- name: Build docker image | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
builder: ${{ steps.buildx.outputs.name }} | |
platforms: linux/amd64 | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
push: false | |
load: true | |
build-args: | | |
TOOLCHAIN_REPOSITORY=ghcr.io/${{ secrets.DOCKER_ORGANIZATION }}/toolchain | |
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }} | |
ROOTFS_FILENAME=${{ env.ROOTFS_FILENAME }} | |
cache-from: type=gha,scope=regular | |
cache-to: type=gha,mode=max,scope=regular | |
- name: Export rootfs.ext2 artifact | |
run: make copy IMG=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs` | |
- name: Export download cache | |
run: make copy-br2-dl-cache CACHE_DIR=${{ env.CACHE_DIR }} IMG=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs` | |
- uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
prerelease: true | |
files: rootfs-*.ext2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} | |
- name: Push docker image | |
id: docker_push | |
uses: docker/build-push-action@v4 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/develop') }} | |
with: | |
context: . | |
builder: ${{ steps.buildx.outputs.name }} | |
platforms: linux/amd64 | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
push: true | |
load: false | |
build-args: | | |
TOOLCHAIN_REPOSITORY=ghcr.io/${{ secrets.DOCKER_ORGANIZATION }}/toolchain | |
TOOLCHAIN_VERSION=${{ env.TOOLCHAIN_VERSION }} | |
cache-from: type=gha,scope=regular | |
cache-to: type=gha,mode=max,scope=regular |