Merge pull request #60 from marcosfad/feature/fixBoot

Make ci manually triggeable.
This commit is contained in:
marcosfad 2022-02-25 23:57:17 +01:00 committed by GitHub
commit e0d7d504e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 29 deletions

View File

@ -2,7 +2,14 @@
name: CI name: CI
# yamllint disable-line rule:truthy # yamllint disable-line rule:truthy
on: on:
[push] push:
workflow_dispatch:
inputs:
KERNEL_VERSION:
required: false
type: string
default: ''
description: (optional) Choose kernel version to use from T2Linux. Without the "v".
jobs: jobs:
build: build:
@ -12,13 +19,37 @@ jobs:
- name: Configure variables - name: Configure variables
id: variables id: variables
if: ${{ inputs.KERNEL_VERSION == '' }}
run: | run: |
KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2) KERNEL_VERSION=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
echo "::set-output name=build::${KERNEL_VERSION}" echo "::set-output name=build::${KERNEL_VERSION}"
- name: Build - name: Download kernel packages
env: env:
KERNEL_VERSION: ${{ steps.variables.outputs.build }} KERNEL_VERSION: ${{ steps.variables.outputs.build }}
run: |
KERNEL_PACKAGES=()
if [[ -n "${KERNEL_VERSION:-}" ]]; then
MBP_KERNEL_TAG=${KERNEL_VERSION}
echo >&2 "===]> Info: Downloading specified kernel: ${MBP_KERNEL_TAG}";
else
MBP_VERSION=t2
MBP_KERNEL_TAG=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
echo >&2 "===]> Info: Downloading latest ${MBP_VERSION} kernel: ${MBP_KERNEL_TAG}";
fi
while IFS='' read -r line; do KERNEL_PACKAGES+=("$line"); done < <(curl -sL https://github.com/t2linux/T2-Ubuntu-Kernel/releases/tag/v"${MBP_KERNEL_TAG}" | grep deb | grep span | cut -d'>' -f2 | cut -d'<' -f1)
mkdir -p "${{ github.workspace }}/files/kernels"
for i in "${KERNEL_PACKAGES[@]}"; do
curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/v"${MBP_KERNEL_TAG}"/"${i}" -o "${{ github.workspace }}/files/kernels/${i}"
done
- name: Check kernel files
run: ls -al "${{ github.workspace }}/files/kernels"
- name: Build
run: sudo ./build.sh run: sudo ./build.sh
- name: print sha256sum - name: print sha256sum
@ -32,21 +63,21 @@ jobs:
- name: Instructions for putting it back together - name: Instructions for putting it back together
run: | run: |
echo "${{ github.workspace }}Release.txt" echo "${{ github.workspace }}/Release.txt"
echo 'Download all the artifacts, and put them in a folder' > ${{ github.workspace }}Release.txt echo 'Download all the artifacts, and put them in a folder' > ${{ github.workspace }}/Release.txt
echo 'without other files. Then run:' >> ${{ github.workspace }}Release.txt echo 'without other files. Then run:' >> ${{ github.workspace }}/Release.txt
echo '`unzip "*.z??.zip"`' >> ${{ github.workspace }}Release.txt echo '`unzip "*.z??.zip"`' >> ${{ github.workspace }}/Release.txt
echo '`cat livecd-${{ steps.variables.outputs.build }}-mbp.z?? > cd.zip`' >> ${{ github.workspace }}Release.txt echo '`cat livecd-${{ steps.variables.outputs.build }}-mbp.z?? > cd.zip`' >> ${{ github.workspace }}/Release.txt
echo '`unzip cd.zip`' >> ${{ github.workspace }}Release.txt echo '`unzip cd.zip`' >> ${{ github.workspace }}/Release.txt
- name: Test release text - name: Test release text
run: cat ${{ github.workspace }}Release.txt run: cat ${{ github.workspace }}/Release.txt
- name: Release - name: Release
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: ${{ github.workspace }}/output/* files: ${{ github.workspace }}/output/*
body_path: ${{ github.workspace }}Release.txt body_path: ${{ github.workspace }}/Release.txt
tag_name: v20.04-${{ steps.variables.outputs.build }} tag_name: v20.04-${{ steps.variables.outputs.build }}
draft: true draft: true
env: env:

View File

@ -9,25 +9,6 @@ debootstrap \
"${CHROOT_PATH}" \ "${CHROOT_PATH}" \
http://archive.ubuntu.com/ubuntu/ http://archive.ubuntu.com/ubuntu/
### Download kernel packages
KERNEL_PACKAGES=()
if [[ -n "${KERNEL_VERSION:-}" ]]; then
MBP_KERNEL_TAG=${KERNEL_VERSION}
echo >&2 "===]> Info: Downloading specified kernel: ${MBP_KERNEL_TAG}";
else
MBP_VERSION=t2
MBP_KERNEL_TAG=$(curl -Ls https://github.com/t2linux/T2-Ubuntu-Kernel/releases/ | grep deb | grep download | grep "${MBP_VERSION}" | cut -d'/' -f6 | head -n1 | cut -d'v' -f2)
echo >&2 "===]> Info: Downloading latest ${MBP_VERSION} kernel: ${MBP_KERNEL_TAG}";
fi
while IFS='' read -r line; do KERNEL_PACKAGES+=("$line"); done < <(curl -sL https://github.com/t2linux/T2-Ubuntu-Kernel/releases/tag/v"${MBP_KERNEL_TAG}" | grep deb | grep span | cut -d'>' -f2 | cut -d'<' -f1)
mkdir -p "${ROOT_PATH}/files/kernels"
for i in "${KERNEL_PACKAGES[@]}"; do
curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/v"${MBP_KERNEL_TAG}"/"${i}" -o "${ROOT_PATH}/files/kernels/${i}"
done
echo >&2 "===]> Info: Creating chroot environment... " echo >&2 "===]> Info: Creating chroot environment... "
mount --bind /dev "${CHROOT_PATH}/dev" mount --bind /dev "${CHROOT_PATH}/dev"
mount --bind /run "${CHROOT_PATH}/run" mount --bind /run "${CHROOT_PATH}/run"