Skip to content

Create Experimental Release #1

Create Experimental Release

Create Experimental Release #1

name: Create Experimental Release
on:
workflow_dispatch:
inputs:
init_arm64:
type: boolean
default: false
description: "Create arm64 Init"
init_x64:
type: boolean
default: false
description: "Create x64 Init"
init_x86:
type: boolean
default: false
description: "Create x86 Init"
kernel_arm64:
type: boolean
default: false
description: "Create arm64 kernel"
kernel_x64:
type: boolean
default: false
description: "Create x64 kernel"
kernel_x86:
type: boolean
default: false
description: "Create x86 kernel"
defaults:
run:
shell: bash
jobs:
input_checks:
runs-on: ubuntu-22.04
steps:
- name: Make at least one workflow input is selected
run: |
init_arm64="${{ inputs.init_arm64 }}"
init_x64="${{ inputs.init_x64 }}"
init_x86="${{ inputs.init_x86 }}"
kernel_arm64="${{ inputs.kernel_arm64 }}"
kernel_x64="${{ inputs.kernel_x64 }}"
kernel_x86="${{ inputs.kernel_x86 }}"
if [ $init_arm64 == "" && $init_x64 == "" && $init_x86 == "" && $kernel_arm64 == "" && $kernel_x64 == "" && $kernel_x86 == "" ]; then
echo "No kernel or init selected."
fi
build_kernel_arm64:
needs: input_checks
if: ${{ inputs.kernel_arm64 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build arm64 kernel
run: ./build.sh -nka arm64
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
build_kernel_x86:
needs: input_checks
if: ${{ inputs.kernel_x86 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build x86 kernel
run: ./build.sh -nka x86
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
build_kernel_x64:
needs: input_checks
if: ${{ inputs.kernel_x64 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build x64 kernel
run: ./build.sh -nka x64
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
build_initrd_arm64:
needs: input_checks
if: ${{ inputs.init_arm64 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build arm64 initrd
run: ./build.sh -nfa arm64
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
- name: Save log file
uses: actions/upload-artifact@v3
with:
name: Buildroot-logs
path: fssourcearm64/buildrootarm64.log
retention-days: 30
build_initrd_x86:
needs: input_checks
if: ${{ inputs.init_x86 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build x86 initrd
run: ./build.sh -nfa x86
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
- name: Save log file
uses: actions/upload-artifact@v3
with:
name: Buildroot-logs
path: fssourcex86/buildrootx86.log
retention-days: 30
build_initrd_x64:
needs: input_checks
if: ${{ inputs.init_x64 }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meld build-essential libncurses5-dev bison flex gcc-aarch64-linux-gnu libelf-dev -y
- name: Build x64 initrd
run: ./build.sh -nfa x64
- name: Run sha256 checksum
run: |
cd dist
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Save distribution files
uses: actions/upload-artifact@v3
with:
name: distribution-files
path: dist
retention-days: 1
- name: Save log file
uses: actions/upload-artifact@v3
with:
name: Buildroot-logs
path: fssourcex64/buildrootx64.log
retention-days: 30
release:
needs:
[
build_kernel_arm64,
build_kernel_x86,
build_kernel_x64,
build_initrd_arm64,
build_initrd_x86,
build_initrd_x64,
]
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download distribution files
uses: actions/download-artifact@v4
- name: Set release name variable
run: |
echo "RELEASE_NAME=Experimental release from $(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Set tag name variable
run: |
echo "TAG_NAME=EXPERIMENTAL_$(date '+%Y%m%d')" >> $GITHUB_ENV
- name: Get Linux Kernel version from build.sh
run: |
echo "LINUX_KERNEL_VER=$(cat build.sh | sed -n -e 's/^.*KERNEL_VERSION=//p' | cut -d\' -f 2)" >> $GITHUB_ENV
- name: Get Buildroot version from build.sh
run: |
echo "BUILDROOT_VER=$(cat build.sh | sed -n -e 's/^.*BUILDROOT_VERSION=//p' | cut -d\' -f 2)" >> $GITHUB_ENV
# - name: Set release name and tag name variable if it is an Official FOG release
# run: |
# is_official="${{ inputs.is_official_release }}"
# fog_version="${{ inputs.official_fog_version }}"
# if [[ ${{ inputs.is_official_release }} == "true" ]]; then
# echo "RELEASE_NAME=FOG $fog_version kernels and inits" >> $GITHUB_ENV
# echo "TAG_NAME=$fog_version" >> $GITHUB_ENV
# fi
- name: Run sha256 checksum on all files
run: |
cd distribution-files
sha256sum -c ./*.sha256
if [[ $? -ne 0 ]]; then exit 1; fi
- name: Create release body
run: |
body_text=""
if [ ${{ inputs.kernel_arm64 }} != "" || ${{ inputs.kernel_x64 }} != "" || ${{ inputs.kernel_x86 }} != "" ]; then
body_text+="Linux kernel ${{ env.LINUX_KERNEL_VER}}"
fi
if [ ${{ inputs.init_arm64 }} != "" || ${{ inputs.init_x64 }} != "" || ${{ inputs.init_x86 }} != "" ]; then
body_text+="\nBuildroot ${{ env.BUILDROOT_VER}}"
fi
echo "RELEASE_BODY_TEXT=$(echo $body_text)" >> $GITHUB_ENV
- name: Create release
uses: softprops/[email protected]
with:
name: ${{ env.RELEASE_NAME }}
body: ${{ env.RELEASE_BODY_TEXT }}
tag_name: ${{ env.TAG_NAME }}
files: |
distribution-files/*