Skip to content

feat: multi-repo release #69

feat: multi-repo release

feat: multi-repo release #69

Workflow file for this run

name: Build PR
on:
pull_request:
branches:
- main
jobs:
build_kernel:
runs-on: ubuntu-latest
container:
image: debian:latest
env:
SHA: ${{ github.event.pull_request.head.sha }}
VERSION: ${{ github.event.pull_request.head.ref }}
outputs:
image_hash: ${{ steps.build_package.outputs.artifact_hash }}
image_name: ${{ steps.build_package.outputs.artifact_name }}
steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Set up okLinux environment
# run: |
# ./deps
# cd kernel
# export CHROMEOS_KERNEL_FAMILY=termina
# - name: Prepare kernel configuration
# run: make olddefconfig
# - name: Build kernel image
# run: make -j$(nproc) bzImage
- name: Build Artifacts Package
id: build_package
# run: |
# cp arch/x86_64/boot/bzImage kernel-x86_64-${VERSION}.tar.gz
run: |
echo "hello world" > kernel-x86_64-${SHA}.tar.gz
sha256sum kernel-x86_64-${SHA}.tar.gz >> kernel-x86_64-${SHA}.tar.gz.sha256
echo "image_name=kernel-x86_64-${SHA}.tar.gz" >> "$GITHUB_OUTPUT"
echo "image_hash=$(cat kernel-x86_64-${SHA}.tar.gz.sha256)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
name: oklinux-kernel-x86_64-${{ github.event.pull_request.head.sha }}
path: kernel-x86_64-*
propose_release:
runs-on: ubuntu-latest
needs: build_kernel
steps:
- env:
VERSION: ${{ github.event.pull_request.head.ref }}
SHA: ${{ github.event.pull_request.head.sha }}
IMAGE_HASH: ${{ needs.build_kernel.outputs.image_hash }}
IMAGE_NAME: ${{ needs.build_kernel.outputs.image_name }}
uses: actions/checkout@v4
with:
repository: "sevki/okLinux"
- name: make download-script
run: |
echo "curl -L https://api.github.com/repos/sevki/kernel/actions/artifacts/1330970479/${IMAGE_NAME} > ${IMAGE_NAME}" > download-kernel.sh
echo $IMAGE_HASH >> ${IMAGE_NAME}.sha256
echo "sha256sum -c ${IMAGE_NAME}.sha256" >> download-kernel.sh
chmod +x download-kernel.sh
- name: create pull request
env:
VERSION: ${{ github.event.pull_request.head.ref }}
SHA: ${{ github.event.pull_request.head.sha }}
IMAGE_HASH: ${{ needs.build_kernel.outputs.image_hash }}
IMAGE_NAME: ${{ needs.build_kernel.outputs.image_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add download-kernel.sh
git add ${IMAGE_NAME}.sha256
git commit -m "Update to${SHA}"
export COMMIT=$(git rev-parse HEAD)
git checkout -b "update-to-${SHA}"
git push origin "update-to-${SHA}"
gh pr create --title "Update to ${SHA}" --body "Update to ${SHA}"
build_kernel_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Setup okLinux environment
run: |
./docdeps
/usr/bin/python3 -m venv sphinx
. sphinx/bin/activate
pip install -r ./Documentation/sphinx/requirements.txt
make htmldocs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./Documentation/output"