Update README.md #998
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: Build Kernel Package | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
paths-ignore: | |
- '.github/workflows/*.yml' | |
- 'apt-repo/*.txt' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 'Checkout repo' | |
uses: actions/checkout@v3 | |
- name: 'Set up Python 3.9' | |
uses: actions/[email protected] | |
- name: 'Install dependencies' | |
run: | | |
python -m pip install --upgrade pip | |
pip install yamllint | |
sudo apt-get install shellcheck bash | |
- name: 'Analysing the code' | |
run: | | |
yamllint . | |
shellcheck ./*.sh | |
build: | |
needs: [lint] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space for the CI | |
uses: AdityaGarg8/remove-unwanted-software@v1 | |
with: | |
remove-android: 'true' | |
remove-dotnet: 'true' | |
remove-haskell: 'true' | |
- name: 'Checkout Repo' | |
uses: actions/checkout@v3 | |
- name: Build script | |
id: build | |
run: | | |
mkdir /tmp/artifacts | |
KREL=$(grep ^KERNEL_REL build.sh | head -n1 | cut -d = -f2) | |
UREL=$(grep ^UBUNTU_REL build.sh | head -n1 | cut -d = -f2) | |
PREL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2) | |
sed -i "s/REL/${KREL}-${UREL}/g" \ | |
${{ github.workspace }}/.github/workflows/instructions.txt | |
DOCKER_IMAGE=ubuntu:23.10 | |
docker pull ${DOCKER_IMAGE} | |
docker run \ | |
-t \ | |
-v "$(pwd)":/repo \ | |
${DOCKER_IMAGE} \ | |
/bin/bash -c 'cd /repo && \ | |
apt-get update && \ | |
apt-get install -y lsb-release && \ | |
mkdir /tmp/artifacts && \ | |
./build.sh && mkdir /repo/debs && \ | |
cp -r /tmp/artifacts/* /repo/debs' | |
cp -r "$(pwd)"/debs/* /tmp/artifacts | |
echo Built $KREL-$UREL-generic-$PREL | |
echo "tag=${KREL}-${UREL}-generic-${PREL}" >> $GITHUB_OUTPUT | |
cd /tmp/artifacts | |
ls -l | |
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz | |
ls -l | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: linux-T2-${{ steps.build.outputs.tag }} | |
path: /tmp/artifacts/* | |
- name: Release | |
if: github.ref == 'refs/heads/Ubuntu' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
/tmp/artifacts/Packages.gz | |
/tmp/artifacts/sha256 | |
/tmp/artifacts/*.deb | |
/tmp/artifacts/kernel_config* | |
tag_name: v${{ steps.build.outputs.tag }} | |
body_path: ${{ github.workspace }}/.github/workflows/instructions.txt | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |