Skip to content

update qemu

update qemu #1

Workflow file for this run

name: qemu
on:
push:
branches:
- main
paths:
- build/qemu.sh
- docker/Dockerfile.qemu
- image-ref/qemu.txt
jobs:
dockerfile-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
with:
filters: |
qemu: docker/Dockerfile.qemu
outputs:
qemu: ${{ steps.filter.outputs.qemu }}
builder-qemu:
runs-on: ubuntu-latest
needs: dockerfile-changes
if: needs.dockerfile-changes.outputs.qemu == 'true'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker buildx create \
--use \
--name builder \
--platform linux/amd64 \
--driver docker-container
docker buildx build \
-f docker/Dockerfile.qemu \
-t ghcr.io/dfinity/qemu-builder:${{ github.sha }} \
--platform linux/amd64 \
--build-arg SOURCE_DATE_EPOCH=0 \
--output type=docker,dest=archive.tar,rewrite-timestamp=true \
.
docker load -i archive.tar
- name: Login to container registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io \
-u ${{ github.actor }} \
--password-stdin
- name: Publish docker image
run: |
docker push ghcr.io/dfinity/qemu-builder:${{ github.sha }}
image-ref-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
with:
filters: |
qemu: image-ref/qemu.txt
outputs:
qemu: ${{ steps.filter.outputs.qemu }}
build-script-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
with:
filters: |
qemu: build/qemu.sh
outputs:
qemu: ${{ steps.filter.outputs.qemu }}
qemu:
runs-on: ubuntu-latest
needs: [image-ref-changes, build-script-changes]
if: needs.image-ref-changes.outputs.qemu == 'true' || needs.build-script-changes.outputs.qemu == 'true'
strategy:
matrix:
include:
- upstream: AMDESE/qemu
ref: 22f8479a3f3c0799980cb9fb230f0b44be5f5eef
steps:
- name: Clone self
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/local
- name: Clone upstream
uses: actions/checkout@v4
with:
repository: ${{ matrix.upstream }}
ref: ${{ matrix.ref }}
path: ${{ github.workspace }}/upstream
submodules: true
- name: Set builder from file
run: echo "BUILDER_REF=$(cat ${{ github.workspace }}/local/image-ref/qemu.txt)" >> $GITHUB_ENV
- name: Login to container registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io \
-u ${{ github.actor }} \
--password-stdin
- name: Build upstream
run: |
docker run --rm \
-v ${{ github.workspace }}/local:/local \
-v ${{ github.workspace }}/upstream:/upstream \
-v ${{ github.workspace }}/build:/build -w /build \
-e SOURCE_DIR="/upstream" \
-e SOURCE_DATE_EPOCH=0 \
ghcr.io/dfinity/qemu-builder:${{ env.BUILDER_REF }} \
bash /local/build/qemu.sh
- name: Set short sha
run: echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c -7)" >> $GITHUB_ENV
- name: Publish
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
tag_name: qemu-${{ env.SHORT_SHA }}
files: |
${{ github.workspace }}/build/qemu_*.deb
body: |
| Name | Value |
| ------------- | ------------- |
| Builder | [ghcr.io/dfinity/qemu-builder:${{ env.BUILDER_REF }}](https://github.com/${{ github.repository }}/pkgs/container/qemu-builder) |
| Local | [${{ github.repository }}:${{ github.sha }}](https://github.com/${{ github.repository }}/tree/${{ github.sha }}) |
| Upstream | [${{ matrix.upstream }}:${{ matrix.ref }}](https://github.com/${{ matrix.upstream }}/tree/${{ matrix.ref }}) |