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
name: Build KPM-DEMO CI | |
on: | |
push: | |
branches: ["main", "dev"] | |
paths: | |
- ".github/workflows/build_kpm_demo.yml" | |
- "kernel/**" | |
- "kpm-demo/**" | |
- "version" | |
pull_request: | |
branches: ["main", "dev"] | |
paths: | |
- ".github/workflows/build_kpm_demo.yml" | |
- "kernel/**" | |
- "kpm-demo/**" | |
- "version" | |
jobs: | |
Build-kpm-demos: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
fetch-depth: 0 | |
- name: Generate version | |
id: parse_version | |
run: | | |
MAJOR=$(grep '#define MAJOR' version | awk '{print $3}') | |
MINOR=$(grep '#define MINOR' version | awk '{print $3}') | |
PATCH=$(grep '#define PATCH' version | awk '{print $3}') | |
VERSION="$MAJOR.$MINOR.$PATCH" | |
echo "Generated Version: $VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
- name: Extract branch name | |
shell: bash | |
id: extract_branch | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
- name: Install Compiler | |
run: | | |
curl -o arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz | |
tar -Jxf arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz | |
- name: Build kpimg | |
run: | | |
export TARGET_COMPILE=`pwd`/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf- | |
cd kpm-demo | |
cd hello | |
make | |
mv hello.kpm hello-demo.kpm | |
cd ../inlinehook | |
make | |
mv inlinehook.kpm inlinehook-demo.kpm | |
cd ../syscallhook | |
make | |
mv syscallhook.kpm syscallhook-demo.kpm | |
- name: Release | |
uses: ncipollo/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.parse_version.outputs.VERSION }}-${{ steps.extract_branch.outputs.branch }} | |
artifacts: | | |
kpm-demo/hello/hello-demo.kpm | |
kpm-demo/inlinehook/inlinehook-demo.kpm | |
kpm-demo/syscallhook/syscallhook-demo.kpm | |
allowUpdates: true | |
replacesArtifacts: true |