|
| 1 | +name: Build Linux kernel deb |
| 2 | + |
| 3 | +on: |
| 4 | + # run weekly on Monday at 8:30am |
| 5 | + schedule: |
| 6 | + - cron: '30 8 * * 1' |
| 7 | + # allow manual runs |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +# only need permission to read repository; implicitely set all other |
| 11 | +# permissions to none |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +env: |
| 16 | + # where results will be posted/hosted |
| 17 | + FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app |
| 18 | + # github runs are only unique per repository and may also be re-run; create a |
| 19 | + # build id for the current run |
| 20 | + BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }} |
| 21 | + |
| 22 | +# cancel in progress builds for this workflow triggered by the same ref |
| 23 | +concurrency: |
| 24 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | +jobs: |
| 28 | + build-linux-deb: |
| 29 | + # for cross-builds |
| 30 | + runs-on: [self-hosted, x86] |
| 31 | + # alternative for native builds, but overkill to do both |
| 32 | + #runs-on: [self-hosted, arm64, debbuilder] |
| 33 | + container: |
| 34 | + image: debian:trixie |
| 35 | + volumes: |
| 36 | + - /srv/gh-runners/quic-yocto/builds:/fileserver-builds |
| 37 | + - /srv/gh-runners/quic-yocto/downloads:/fileserver-downloads |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + fetch-depth: 0 |
| 42 | + |
| 43 | + # make sure we have latest packages first, to get latest fixes, to avoid |
| 44 | + # an automated update while we're building, and to prevent version skews |
| 45 | + - name: Update OS packages |
| 46 | + run: | |
| 47 | + set -ux |
| 48 | + apt update |
| 49 | + apt -y upgrade |
| 50 | + apt -y full-upgrade |
| 51 | +
|
| 52 | + - name: Build Linux kernel deb |
| 53 | + run: | |
| 54 | + set -ux |
| 55 | + # download arm64 package lists to install cross build-dependencies |
| 56 | + if [ "$(dpkg --print-architecture)" != arm64 ]; then |
| 57 | + dpkg --add-architecture arm64 |
| 58 | + apt update |
| 59 | + fi |
| 60 | + # install build-dependencies; TODO: --no-install-recommends |
| 61 | + apt -y install git crossbuild-essential-arm64 make flex bison bc \ |
| 62 | + libelf-dev libssl-dev libssl-dev:arm64 dpkg-dev \ |
| 63 | + debhelper-compat kmod python3 rsync coreutils |
| 64 | + scripts/build-linux-deb.sh |
| 65 | +
|
| 66 | + - name: Upload results to fileserver |
| 67 | + run: | |
| 68 | + set -ux |
| 69 | + # dcmd from devscripts will be used to parse .changes file |
| 70 | + apt -y install --no-install-recommends devscripts |
| 71 | + # curl will be used to talk to fileserver; should be installed by |
| 72 | + # default |
| 73 | + apt -y install curl |
| 74 | + # copy to fileserver builds and downloads directories |
| 75 | + for dir in "/fileserver-builds/${BUILD_ID}" \ |
| 76 | + "/fileserver-downloads/qcom-deb-images/linux-deb-latest"; do |
| 77 | + mkdir -vp "${dir}" |
| 78 | + cp -av `dcmd *.changes` "${dir}" |
| 79 | + done |
| 80 | + # perhaps help NFS sync |
| 81 | + sync |
| 82 | + # instruct fileserver to publish this directory |
| 83 | + url="${FILESERVER_URL}/${BUILD_ID}/" |
| 84 | + curl -X POST -H 'Accept: text/event-stream' "${url}" |
0 commit comments