Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

v0.0.4

v0.0.4 #96

Workflow file for this run

name: Build
on:
push:
release:
types: [published]
jobs:
build:
name: Build QEMU
strategy:
# The matrix will run all possible combinations in parallel.
matrix:
# ubuntu-20.04 so that we don't depend on a recent glibc.
container: [
{ os: ubuntu-20.04, shell: bash },
{ os: macos-latest, shell: bash },
{ os: windows-latest, shell: 'msys2 {0}' }
]
runs-on: ${{ matrix.container.os }}
defaults:
run:
shell: ${{ matrix.container.shell }}
steps:
- uses: actions/checkout@v3
- name: Ccache cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: ${{ runner.os }}-ccache-
# Fetch the dependencies. Different for each platform.
- name: Install dependencies - Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -q ninja-build libgcrypt20 libgcrypt20-dev ccache libslirp0 libslirp-dev
ninja --version
- name: Install dependencies - macOS
if: runner.os == 'macOS'
run: |
brew install ninja ccache
ninja --version
- name: Install dependencies - Windows
if: runner.os == 'Windows'
uses : msys2/setup-msys2@v2
with:
update: true
install: |
base-devel
mingw-w64-x86_64-toolchain
git
python
ninja
mingw-w64-x86_64-glib2
mingw-w64-x86_64-pixman
python-setuptools
mingw-w64-x86_64-libslirp
mingw-w64-x86_64-libgcrypt
mingw-w64-x86_64-ccache
- name: Set workspace path
working-directory: ${{ github.workspace }}
run: |
echo "WORKSPACE=$(pwd)" >> $GITHUB_ENV
- name: Ccache zero stats
env:
CCACHE_DIR: ${{ env.WORKSPACE }}/.ccache
CCACHE_BASEDIR: ${{ env.WORKSPACE }}
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: '6'
CCACHE_MAXSIZE: 400M
run: |
ccache -z
- name: Configure
env:
CC: ccache gcc
CXX: ccache g++
CCACHE_DIR: ${{ env.WORKSPACE }}/.ccache
CCACHE_BASEDIR: ${{ env.WORKSPACE }}
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: '6'
CCACHE_MAXSIZE: 400M
run: |
./configure \
--prefix=/ \
--target-list=xtensa-softmmu \
--disable-capstone \
--disable-vnc \
--enable-gcrypt \
--disable-curl \
--disable-qga-vss
- name: Build
env:
CCACHE_DIR: ${{ env.WORKSPACE }}/.ccache
CCACHE_BASEDIR: ${{ env.WORKSPACE }}
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: '6'
CCACHE_MAXSIZE: 400M
run: |
make -j$(nproc)
- name: Ccache stats
env:
CCACHE_DIR: ${{ env.WORKSPACE }}/.ccache
CCACHE_BASEDIR: ${{ env.WORKSPACE }}
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: '6'
CCACHE_MAXSIZE: 400M
run: |
ccache -s
- name: Install
run: |
mkdir -p qemu-${{ runner.os }}-tmp
make -C build install DESTDIR=$(pwd)/qemu-${{ runner.os }}-tmp
- name: Move archive files - Windows
# The installation prefixes the actual path with the path of the msys2
# directory.
# For simplicity find the path of the executable and use its dirname, then
# replace the original installation directory with the new one.
if: runner.os == 'Windows'
shell: bash
run: |
INSTALL_DIR=${{ env.WORKSPACE }}/qemu-${{ runner.os }}-tmp
mv $INSTALL_DIR $INSTALL_DIR.tmp
qemu_path=$(dirname $(find $INSTALL_DIR.tmp -name qemu-system-xtensa.exe))
mv $qemu_path $INSTALL_DIR
- name: Create archive - Linux/macOS
if: runner.os != 'Windows'
shell: bash
run: |
find qemu-${{ runner.os }}-tmp
mkdir qemu-${{ runner.os }}
cp qemu-${{ runner.os }}-tmp/bin/qemu-system-xtensa qemu-${{ runner.os }}
cp qemu-${{ runner.os }}-tmp/share/qemu/esp32* qemu-${{ runner.os }}
tar -czf qemu-${{ runner.os }}.tar.gz qemu-${{ runner.os }}
- name: Create archive - Windows
if: runner.os == 'Windows'
shell: bash
run: |
find qemu-${{ runner.os }}-tmp
mkdir qemu-${{ runner.os }}
cp qemu-${{ runner.os }}-tmp/qemu-system-xtensa.exe qemu-${{ runner.os }}
cp qemu-${{ runner.os }}-tmp/share/esp32* qemu-${{ runner.os }}
tar -czf qemu-${{ runner.os }}.tar.gz qemu-${{ runner.os }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: qemu-${{ runner.os }}
path: |
qemu-${{ runner.os }}.tar.gz
- name: Upload release artifacts
if: |
github.event_name == 'release' &&
github.repository_owner == 'toitlang'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: qemu-${{ runner.os }}.tar.gz
tag: ${{ github.ref }}
overwrite: true