Skip to content

Commit

Permalink
chore(ci): add ci
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cui <bh@bugs.cc>
  • Loading branch information
BlackHole1 committed Feb 2, 2024
1 parent 737a251 commit 72f1930
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8

[*.yml]
indent_style = space
indent_size = 2
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- add-ci

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
target:
- initrd
- rootfs
- kernel
arch:
- arm64
- amd64

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Update kernel submodules
if: ${{ matrix.target == 'kernel'}}
run: git submodule update --init kernel

- name: Update buildroot submodules
if: ${{ matrix.target != 'kernel'}}
run: git submodule update --init buildroot

- name: Defconfig
run: make ${{ matrix.target }}-${{ matrix.arch }}-defconfig

- name: Build
run: make ${{ matrix.target }}-${{ matrix.arch }}-build

- name: List file
run: make print-outpath-${{ matrix.target }}-${{ matrix.arch }}
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: %-build build rootfs-%-defconfig rootfs-%-savedefconfig %-nconfig %-menuconfig %-clean clean help rootfs-% initrd-% kernel-%
.PHONY: %-build build rootfs-%-defconfig rootfs-%-savedefconfig %-nconfig %-menuconfig %-clean clean help rootfs-% initrd-% kernel-% print-outpath-%

ROOTDIR := $(realpath .)

Expand Down Expand Up @@ -234,6 +234,30 @@ clean: ##@ Clean all build files
##@ Misc commands
##@

print-outpath-%: ##@ Print out path of specified architecture
$(eval _TARGET := $(firstword $(subst -, ,$*)))
$(eval _ARCH := $(word 2, $(subst -, ,$*)))

@case $(_TARGET) in \
rootfs) \
echo -n $(ROOTDIR)/out/rootfs/$(_ARCH)/images/rootfs.erofs; \
;; \
initrd) \
echo -n $(ROOTDIR)/out/initrd/$(_ARCH)/images/initrd.gz; \
;; \
kernel) \
if [ $(_ARCH) == arm64 ]; then \
echo -n $(ROOTDIR)/out/kernel/arm64/arch/arm64/boot/Image; \
else \
echo -n $(ROOTDIR)/out/kernel/amd64/arch/x86/boot/bzImage; \
fi; \
;; \
*) \
printf "Please specify a print-outpath command\n" \
exit 1 \
;; \
esac \

help: ##@ (Default) Print listing of key targets with their descriptions
@printf "\nUsage: make <command>\n"
@grep -F -h "##@" $(MAKEFILE_LIST) | grep -F -v grep -F | sed -e 's/\\$$//' | awk 'BEGIN {FS = ":*[[:space:]]*##@[[:space:]]*"}; \
Expand Down

0 comments on commit 72f1930

Please sign in to comment.