diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c408c0b --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9228327 --- /dev/null +++ b/Dockerfile @@ -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" ]