Update build.yaml #3
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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - rk-mainline | |
| - rk6.1-rkr3 | |
| name: Build kernel | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| steps: | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y | |
| sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \ | |
| u-boot-tools binfmt-support flex libssl-dev bc rsync kmod cpio xz-utils fakeroot \ | |
| udev dosfstools uuid-runtime device-tree-compiler python3 python-is-python3 \ | |
| bc debhelper swig libfdt-dev libpython3-dev dctrl-tools | |
| - name: Checkout Kernel repo | |
| uses: actions/checkout@v4 | |
| - name: Build Kernel at ${{ github.sha }} | |
| shell: bash | |
| run: | | |
| export $(dpkg-architecture -aarm64) | |
| export CROSS_COMPILE=aarch64-linux-gnu- | |
| export CC=aarch64-linux-gnu-gcc | |
| export LANG=C | |
| fakeroot debian/rules clean binary-headers binary-rockchip do_mainline_build=true | |
| - name: Workaround actions | |
| run: | | |
| echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| path: | | |
| ${{ env.artifacts_path }}/*.deb | |
| release: | |
| needs: build | |
| runs-on: [ self-hosted, ubuntu-24.04, pkg ] | |
| if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ameridroid/apt-repo | |
| path: repo | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y reprepro gnupg git unzip openssh-client | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| - name: Extract artifacts | |
| run: | | |
| ls *.deb | |
| - name: Import GPG and ssh key | |
| env: | |
| GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| SSH_KEY: ${{ secrets.APT_SSH_KEY }} | |
| run: | | |
| echo "$GPG_KEY" | gpg --import | |
| gpg --list-keys | |
| mkdir -p ~/.ssh | |
| echo "$SSH_KEY" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| - name: Upload packages to APT repository | |
| run: | | |
| cd ./repo | |
| for package in ../*.deb; do | |
| for codename in bookworm-testing trixie-testing sid-testing oracular-testing; do | |
| reprepro --ignore=wrongdistribution includedeb $codename $package | |
| done | |
| done | |
| - name: Push updated repository to main branch | |
| run: | | |
| ls | |
| cd ./repo | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "[email protected]" | |
| git add -A | |
| git commit -m "Update ${{ github.event.repository.name}}" || echo "No changes to commit" | |
| git remote set-url origin [email protected]:ameriDroid/apt-repo.git | |
| git push origin main |