This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
Deploying mainline kernel packages #92
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: Deploying mainline kernel packages | |
on: | |
schedule: | |
- cron: "50 0 * * *" # run at the start of every day | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-sha: | |
runs-on: ubuntu-latest | |
outputs: | |
match_results: ${{ steps.check-shas.outputs.match_results }} | |
remote_tag: ${{ steps.check-shas.outputs.remote_tag }} | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Download remote commit shas | |
id: check-shas | |
run: | | |
# Download remote sha | |
latest_tag=$(curl -s https://api.github.com/repos/eupnea-project/linux-kernels/releases/tags/latest-mainline | jq -r '.id') | |
# fail if curl result is empty | |
if [[ "$latest_tag" = "null" ]]; then | |
echo "latest_tag is empty" | |
exit 1 | |
fi | |
# Check remote tag against cached one | |
match_results=$([[ "$(cat cache/mainline_kernel_tag-cache.txt)" == "$latest_tag" ]] && echo "true" || echo "false") | |
echo "match_results=$match_results" >> $GITHUB_OUTPUT | |
# Add sha to output | |
echo "remote_tag=$latest_tag" >> $GITHUB_OUTPUT | |
deploy-repo: | |
runs-on: ubuntu-latest | |
needs: check-sha # needs for the vars from the previous job | |
# Only run script when remote sha has changed, aka the results DON'T match | |
if: needs.check-sha.outputs.match_results == 'false' | |
steps: | |
- name: Checking out repository code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Update local tag releases cache file | |
run: | | |
echo "${{ needs.check-sha.outputs.remote_tag }}" > cache/mainline_kernel_tag-cache.txt | |
- name: Bump version in kernel control file | |
run: | | |
CURRENT_VERSION=$(sed -n '2p' control-files/mainline-kernel-control | sed 's/.*://' | xargs) # get current version from control file | |
NEXTVERSION=$(echo ${CURRENT_VERSION} | awk -F. -v OFS=. '{$NF += 1 ; print}') # bump version | |
sed -i "2s/.*/Version: ${NEXTVERSION}/" control-files/mainline-kernel-control # update version in control file | |
- name: Bump version in modules control file | |
run: | | |
CURRENT_VERSION=$(sed -n '2p' control-files/mainline-kernel-modules-control | sed 's/.*://' | xargs) # get current version from control file | |
NEXTVERSION=$(echo ${CURRENT_VERSION} | awk -F. -v OFS=. '{$NF += 1 ; print}') # bump version | |
sed -i "2s/.*/Version: ${NEXTVERSION}/" control-files/mainline-kernel-modules-control # update version in control file | |
- name: Bump version in headers control file | |
run: | | |
CURRENT_VERSION=$(sed -n '2p' control-files/mainline-kernel-headers-control | sed 's/.*://' | xargs) # get current version from control file | |
NEXTVERSION=$(echo ${CURRENT_VERSION} | awk -F. -v OFS=. '{$NF += 1 ; print}') # bump version | |
sed -i "2s/.*/Version: ${NEXTVERSION}/" control-files/mainline-kernel-headers-control # update version in control file | |
- name: Packing kernel packages | |
run: bash pack-scripts/pack-mainline-kernel.sh | |
- name: Updating files in main branch | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
# Disable setting repo owner as commit author | |
commit_user_name: github-actions[bot] | |
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com | |
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
# Optional. Commit message for the created commit. | |
# Defaults to "Apply automatic changes" | |
commit_message: Update files in main branch | |
# Only include needed files | |
file_pattern: 'control-files/mainline-kernel-control control-files/mainline-kernel-modules-control control-files/mainline-kernel-headers-control cache/mainline_kernel_tag-cache.txt' | |
- name: Adding stable mainline kernel packages | |
uses: smeinecke/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repo_supported_arch: | | |
amd64 | |
i386 # 32 bit systems arent really supported but apt throws a warning otherwise | |
repo_supported_version: | | |
mantic | |
jammy | |
stable | |
file: eupnea-mainline-kernel*.deb | |
file_target_version: stable | |
public_key: ${{ secrets.PUBLIC }} | |
private_key: ${{ secrets.PRIVATE }} | |
key_passphrase: "" | |
repo_folder: "debian_ubuntu" | |
- name: Adding jammy mainline kernel packages | |
uses: smeinecke/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repo_supported_arch: | | |
amd64 | |
i386 # 32 bit systems arent really supported but apt throws a warning otherwise | |
repo_supported_version: | | |
mantic | |
jammy | |
stable | |
file: eupnea-mainline-kernel*.deb | |
file_target_version: jammy | |
public_key: ${{ secrets.PUBLIC }} | |
private_key: ${{ secrets.PRIVATE }} | |
key_passphrase: "" | |
repo_folder: "debian_ubuntu" | |
- name: Adding mantic mainline kernel packages | |
uses: smeinecke/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repo_supported_arch: | | |
amd64 | |
i386 # 32 bit systems arent really supported but apt throws a warning otherwise | |
repo_supported_version: | | |
mantic | |
jammy | |
stable | |
file: eupnea-mainline-kernel*.deb | |
file_target_version: mantic | |
public_key: ${{ secrets.PUBLIC }} | |
private_key: ${{ secrets.PRIVATE }} | |
key_passphrase: "" | |
repo_folder: "debian_ubuntu" |