ayufan: add CI support with dev.mk #5
This file contains hidden or 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
| on: [push] | |
| env: | |
| RELEASE_START: 1150 # 1150, as this is latest build by GitLab CI | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| container: ayufan/rock64-dockerfiles:bookworm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Docker binary | |
| run: | | |
| apt-get -y update | |
| apt-get -y install docker.io | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Configure ccache | |
| run: | | |
| echo "CCACHE_DIR=$PWD/out/ccache" >> $GITHUB_ENV | |
| echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV | |
| - name: Cache Primes | |
| id: cache-ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: out/ccache | |
| key: ${{ runner.os }}-ccache | |
| - name: Reset ccache statistics | |
| run: ccache -M 0 -F 0 | |
| - name: Build package | |
| run: | | |
| export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) | |
| ./dev-make kernel-package | |
| - name: Release package | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -x | |
| export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) | |
| export RELEASE_NAME="$(./dev-make version)" | |
| export RELEASE_TITLE="$(./dev-make version)" | |
| export DESCRIPTION="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | |
| github-release release \ | |
| --tag "${RELEASE_NAME}" \ | |
| --name "${RELEASE_TITLE}" \ | |
| --user "${GITHUB_REPOSITORY%/*}" \ | |
| --repo "${GITHUB_REPOSITORY#*/}" \ | |
| --description "${DESCRIPTION}" \ | |
| --target "${GITHUB_SHA}" \ | |
| --draft | |
| sleep 3s # allow to update release | |
| for i in ../*$(./dev-make info)*.deb; do | |
| github-release upload \ | |
| --tag "${RELEASE_NAME}" \ | |
| --name "$(basename "${i}")" \ | |
| --user "${GITHUB_REPOSITORY%/*}" \ | |
| --repo "${GITHUB_REPOSITORY#*/}" \ | |
| --file "${i}" | |
| done | |
| github-release edit \ | |
| --tag "${RELEASE_NAME}" \ | |
| --name "${RELEASE_TITLE}" \ | |
| --user "${GITHUB_REPOSITORY%/*}" \ | |
| --repo "${GITHUB_REPOSITORY#*/}" \ | |
| --description "${DESCRIPTION}" | |
| rm ../*$(./dev-make info)*.deb |