Build Arch Repository #6
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
| name: Build aarch64 repo packages | |
| on: | |
| workflow_dispatch: | |
| # schedule: | |
| # - cron: "0 0 * * *" | |
| # push: | |
| # branches: | |
| # - main | |
| # paths-ignore: | |
| # - "**/README.md" | |
| jobs: | |
| build-linux-firmware: | |
| name: Build Linux firmware package | |
| runs-on: ubuntu-22.04-arm | |
| container: danhunsaker/archlinuxarm | |
| steps: | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| uname -a | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git rdfind | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Package | |
| run: | | |
| cd linux-firmware | |
| # Fix permissions (can't makepkg as root) | |
| echo "nobody ALL=(ALL) NOPASSWD: /usr/bin/pacman" >> /etc/sudoers | |
| chown -R nobody . | |
| # Package compression settings (Matches latest Arch) | |
| export PKGEXT='.pkg.tar.xz' | |
| # export COMPRESSZST=(zstd -c -T0 --ultra -20 -) | |
| export MAKEFLAGS="-j2" | |
| # Build linux-firmware | |
| chage -E -1 nobody | |
| su nobody --pty -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' | |
| # Build linux-firmware-lenovo-sm8250 | |
| cd ../linux-firmware-lenovo-sm8250 | |
| chown -R nobody . | |
| su nobody --pty -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' | |
| - name: Prepare release | |
| run: | | |
| mkdir firmware-release | |
| cp linux-firmware/*.pkg.tar.xz firmware-release | |
| cp linux-firmware-lenovo-sm8250/*.pkg.tar.xz firmware-release | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-firmware-aarch64-latest | |
| path: firmware-release | |
| build-kernel-sm8250: | |
| name: Build Linux sm8250 kernel package | |
| runs-on: ubuntu-22.04-arm | |
| container: danhunsaker/archlinuxarm | |
| steps: | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| uname -a | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git rdfind | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git \ | |
| xmlto docbook-xsl kmod inetutils bc dtc \ | |
| gcc python3 | |
| # Fix permissions (can't makepkg as root) | |
| chage -E -1 nobody | |
| echo "nobody ALL=(ALL) NOPASSWD: /usr/bin/pacman" >> /etc/sudoers | |
| - name: Build Package | |
| run: | | |
| cd linux-sm8250 | |
| git config --global user.email "chalkinbot@users.noreply.github.com" | |
| git config --global user.name "chalkinbot" | |
| # Fix permissions (can't makepkg as root) | |
| chown -R nobody . | |
| # Package compression settings (Matches latest Arch) | |
| export PKGEXT='.pkg.tar.xz' | |
| # export COMPRESSZST=(zstd -c -T0 --ultra -20 -) | |
| export MAKEFLAGS="-j9" | |
| # Build | |
| su nobody --pty -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' | |
| - name: Prepare release | |
| run: | | |
| mkdir release | |
| cp linux-sm8250/*.pkg.tar.xz release | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-sm8250-aarch64-latest | |
| path: release | |
| build-kernel-sdm845: | |
| name: Build Linux kernel package | |
| runs-on: ubuntu-22.04-arm | |
| container: danhunsaker/archlinuxarm | |
| steps: | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| uname -a | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git rdfind | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git \ | |
| xmlto docbook-xsl kmod inetutils bc dtc \ | |
| gcc python3 | |
| # Fix permissions (can't makepkg as root) | |
| chage -E -1 nobody | |
| echo "nobody ALL=(ALL) NOPASSWD: /usr/bin/pacman" >> /etc/sudoers | |
| - name: Build Package | |
| run: | | |
| cd linux-sdm845 | |
| git config --global user.email "chalkinbot@users.noreply.github.com" | |
| git config --global user.name "chalkinbot" | |
| # Fix permissions (can't makepkg as root) | |
| chown -R nobody . | |
| # Package compression settings (Matches latest Arch) | |
| export PKGEXT='.pkg.tar.xz' | |
| # export COMPRESSZST=(zstd -c -T0 --ultra -20 -) | |
| export MAKEFLAGS="-j9" | |
| # Build | |
| su nobody --pty -p -s /bin/bash -c 'makepkg -f --syncdeps --skippgpcheck --noconfirm' | |
| - name: Prepare release | |
| run: | | |
| mkdir release | |
| mv linux-sdm845/*.pkg.tar.xz release | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-sdm845-aarch64-latest | |
| path: release | |
| build-packages: | |
| needs: [build-linux-firmware] | |
| runs-on: ubuntu-22.04-arm | |
| container: danhunsaker/archlinuxarm | |
| env: | |
| BUILD_ALARM_SH: 'sudo su - alarm -c' | |
| steps: | |
| - name: Install build dependencies | |
| run: | | |
| # Install makepkg deps | |
| uname -a | |
| pacman --noconfirm -Syu | |
| pacman --noconfirm -S sudo binutils fakeroot base-devel git rdfind | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: Set variables | |
| run: | | |
| echo RELEASE=$(date +%Y\/%m\/%d) >> $GITHUB_ENV | |
| shell: bash | |
| - name: Setup builder | |
| run: | | |
| curl -L -o /etc/pacman.conf https://github.com/silime/ArchlinuxARM-qcom-aarch64/raw/main/pacman.conf | |
| pacman-key --init && pacman-key --populate archlinuxarm | |
| pacman-key --recv-keys F60FD4C6D426DAB6 | |
| pacman-key --lsign F60FD4C6D426DAB6 | |
| pacman -Syyu --noconfirm --ask=4 arch-install-scripts cloud-guest-utils sudo binutils fakeroot base-devel git | |
| useradd -m alarm | |
| passwd -d alarm | |
| usermod -aG wheel alarm | |
| echo 'alarm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
| cp {build.sh,qcom.yaml} /home/alarm/ | |
| chown alarm /home/alarm/* | |
| ./build.sh qcom qcom "${{ secrets.GPG_PASSPHRASE }}" | |
| shell: bash | |
| - name: Setup GPG | |
| run: | | |
| # Import the GPG private key | |
| echo 1 | |
| ${{ env.BUILD_ALARM_SH }} 'echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --passphrase "${{ secrets.GPG_PASSPHRASE }}" --pinentry-mode loopback' | |
| # Configure the GPG agent to use the passphrase | |
| echo 2 | |
| ${{ env.BUILD_ALARM_SH }} 'echo "default-cache-ttl 18000" > ~/.gnupg/gpg-agent.conf' | |
| echo 3 | |
| ${{ env.BUILD_ALARM_SH }} 'echo "max-cache-ttl 18000" >> ~/.gnupg/gpg-agent.conf' | |
| echo 4 | |
| ${{ env.BUILD_ALARM_SH }} 'gpgconf --reload gpg-agent' | |
| echo 5 | |
| - name: Sign the file | |
| run: | | |
| ${{ env.BUILD_ALARM_SH }} 'echo "This is a test file." > ~/testfile.txt' | |
| ${{ env.BUILD_ALARM_SH }} 'gpg --armor --detach-sign --passphrase "${{ secrets.GPG_PASSPHRASE }}" --pinentry-mode loopback --output ~/testfile.sig ~/testfile.txt' | |
| - name: Build packages | |
| run: | | |
| ${{ env.BUILD_ALARM_SH }} 'git config --global user.email "chalkinbot@users.noreply.github.com"' | |
| ${{ env.BUILD_ALARM_SH }} 'git config --global user.name "chalkinbot"' | |
| ${{ env.BUILD_ALARM_SH }} 'ls -l' | |
| ${{ env.BUILD_ALARM_SH }} './build.sh qcom qcom "${{ secrets.GPG_PASSPHRASE }}"' | |
| ${{ env.BUILD_ALARM_SH }} 'ls -l' | |
| ${{ env.BUILD_ALARM_SH }} 'tar -cvf logs.tar ./build/logs/*' | |
| - name: create artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs | |
| path: ./build/logs.tar # or path/to/artifact | |
| - name: create release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| body: ${{ env.RELEASE }} | |
| tag_name: ${{ env.RELEASE }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| ./build/repo/qcom/* | |
| # - name: delete old releases | |
| # uses: dev-drprasad/delete-older-releases@v0.3.4 | |
| # with: | |
| # keep_latest: 1 | |
| # delete_tags: true | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |