-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: ci | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: linux/amd64 | ||
arch_name: amd64 | ||
- platform: linux/riscv64 | ||
arch_name: riscv64 | ||
|
||
steps: | ||
- name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
build_date=$(date "+%Y.%m.%d") | ||
echo "BUILD_DATE=${build_date}" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Rootfs | ||
run: | | ||
#wget https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-${{ matrix.arch_name }}-root.tar.xz | ||
wget -o ${{ matrix.arch_name }}.tar.xz \ | ||
https://cloud-images.ubuntu.com/mantic/current/mantic-server-cloudimg-${{ matrix.arch_name }}-root.tar.xz | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io/revyos | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
platforms: ${{ matrix.platform }} | ||
build-args: | | ||
arch_name=${{ matrix.arch_name }} | ||
tags: | | ||
revyos-kernel-builder:${{ matrix.arch_name }}-${{ env.BUILD_DATE }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM scratch | ||
|
||
LABEL org.opencontainers.image.authors="gaohan@iscas.ac.cn" | ||
|
||
ARG arch_name | ||
|
||
ADD ${arch_name}.tar.xz / | ||
|
||
RUN apt update && \ | ||
apt install -y gdisk dosfstools build-essential \ | ||
libncurses-dev gawk flex bison openssl libssl-dev tree \ | ||
dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf device-tree-compiler \ | ||
devscripts pahole bc rsync bash wget cpio sudo python-is-python3 | ||
|
||
RUN apt install -y nodejs | ||
|
||
RUN ln -sf /bin/bash /bin/sh | ||
|
||
CMD [ "/bin/bash" ] |