mirror of
https://github.com/FOGProject/fos.git
synced 2026-02-04 21:57:54 -06:00
290 lines
7.8 KiB
YAML
290 lines
7.8 KiB
YAML
name: Create Latest/Official Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
is_official_release:
|
|
type: boolean
|
|
default: false
|
|
description: "Official Release?"
|
|
required: false
|
|
official_fog_version:
|
|
type: string
|
|
description: "Official Release FOG Version"
|
|
required: false
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
input_checks:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Make sure that the input text field is filled in if the input checkbox is selected and vice versa
|
|
run: |
|
|
is_official="${{ inputs.is_official_release }}"
|
|
fog_version="${{ inputs.official_fog_version }}"
|
|
if [[ "$is_official" == "true" && "$fog_version" == "" ]]; then
|
|
echo "Official FOG Version was not entered, but Official Release checkbox was selected!"
|
|
exit 1
|
|
fi
|
|
if [[ "$is_official" == "false" && "$fog_version" != "" ]]; then
|
|
echo "Official Release checkbox was not selected, but Official Release FOG Version was entered!"
|
|
exit 1
|
|
fi
|
|
|
|
build_kernel_arm64:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build arm64 kernel
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-kernel-arm64
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
build_kernel_x86:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build x86 kernel
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-kernel-x86
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
build_kernel_x64:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build x64 kernel
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-kernel-x64
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
build_initrd_arm64:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build arm64 initrd
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-initrd-arm64
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
- name: Save log file
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Buildroot-logs-arm64
|
|
path: fssourcearm64/buildrootarm64.log
|
|
retention-days: 30
|
|
|
|
build_initrd_x86:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build x86 initrd
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-initrd-x86
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
- name: Save log file
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Buildroot-logs-x86
|
|
path: fssourcex86/buildrootx86.log
|
|
retention-days: 30
|
|
|
|
build_initrd_x64:
|
|
needs: input_checks
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build x64 initrd
|
|
run: ./build.sh --install-dep -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@v4
|
|
with:
|
|
name: distribution-files-initrd-x64
|
|
path: dist
|
|
retention-days: 1
|
|
|
|
- name: Save log file
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Buildroot-logs-x64
|
|
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
|
|
with:
|
|
pattern: distribution-files-*
|
|
merge-multiple: true
|
|
path: distribution-files
|
|
|
|
# DO NOT change the release name. FOG uses this format to grab the releases for the Kernel Update page.
|
|
- name: Set release name variable
|
|
run: |
|
|
echo "RELEASE_NAME=Latest from $(date '+%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
- name: Set tag name variable
|
|
run: |
|
|
echo "TAG_NAME=$(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
|
|
|
|
# DO NOT change the release name. FOG uses this format to grab the releases for the Kernel Update page.
|
|
- 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
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ env.RELEASE_NAME }}
|
|
body: |
|
|
Linux kernel ${{ env.LINUX_KERNEL_VER }}
|
|
Buildroot ${{ env.BUILDROOT_VER }}
|
|
tag_name: ${{ env.TAG_NAME }}
|
|
files: |
|
|
distribution-files/arm_Image
|
|
distribution-files/arm_Image.sha256
|
|
distribution-files/arm_init.cpio.gz
|
|
distribution-files/arm_init.cpio.gz.sha256
|
|
distribution-files/bzImage
|
|
distribution-files/bzImage.sha256
|
|
distribution-files/bzImage32
|
|
distribution-files/bzImage32.sha256
|
|
distribution-files/init.xz
|
|
distribution-files/init.xz.sha256
|
|
distribution-files/init_32.xz
|
|
distribution-files/init_32.xz.sha256
|