Skip to content

Commit

Permalink
feat: multi-repo release
Browse files Browse the repository at this point in the history
  • Loading branch information
sevki committed Mar 16, 2024
1 parent c9e1dba commit 4eb405e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
schedule:
- cron: '44 8 * * 2'
# also trigger on when commented /scan-codeql on the pr
issue_comment:
types: [created]
pattern: /scan

jobs:
analyze:
Expand Down
50 changes: 42 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ jobs:
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@v2
uses: actions/checkout@v4
- name: Set up okLinux environment
run: |
./deps
Expand All @@ -23,14 +28,43 @@ jobs:

- 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
echo "image_name=kernel-x86_64-${VERSION}.tar.gz" >> "$GITHUB_OUTPUT"
sha256sum kernel-x86_64-${VERSION}.tar.gz >> kernel-x86_64-${VERSION}.tar.gz.sha256
echo "image_hash=$(cat sha256sum kernel-x86_64-${VERSION}.tar.gz)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
name: x86_64
path: arch/x86_64
- uses: actions/upload-artifact@v4
name: oklinux-kernel-x86_64
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:
name: bzImage
path: arch/x86_64/boot/bzImage
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
uses: peter-evans/create-pull-request@v6
with:
repository: "sevki/kernel"
message: "Update Kernel to ${VERSION}"
add-paths: |
download-kernel.sh
build_kernel_docs:
runs-on: ubuntu-latest
steps:
Expand All @@ -48,4 +82,4 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './Documentation/output'
path: "./Documentation/output"

0 comments on commit 4eb405e

Please sign in to comment.