Auto Build Arch Packages #382
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: Auto Build Arch Packages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '!pacman-hooks' | |
- '!LICENSE' | |
- '!README.md' | |
- '!.gitignore' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '!pacman-hooks' | |
- '!LICENSE' | |
- '!README.md' | |
- '!.gitignore' | |
workflow_dispatch: | |
jobs: | |
package-build: | |
name: Build and Upload Packages for PKGBUILD in this repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install QEMU-User-Static | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static | |
- name: Check QEMU User Static Flag | |
id: check-qemu | |
run: | | |
result=true | |
while read -r file | |
do | |
interpreter=$(grep interpreter "$file" | sed 's/interpreter //') | |
flags=$(grep flags "$file" | sed 's/flags: //') | |
echo "$interpreter's flags is $flags" | |
if [[ "$interpreter" =~ aarch64- ]] && ! [[ "$flags" =~ OCF ]] | |
then | |
result=false | |
break | |
fi | |
done < <(find /proc/sys/fs/binfmt_misc -mindepth 1 -maxdepth 1 ! -name register ! -name status) | |
echo result=$result >> $GITHUB_OUTPUT | |
- name: Fix QEMU User Static Flag | |
if: steps.check-qemu.result == 'false' | |
run: sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: bash start-build.sh | |
- name: Generare Release info | |
if: ${{ github.event_name == 'push' }} | |
id: release-info | |
run: | | |
cd out | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "sums<<$EOF" >> "$GITHUB_OUTPUT" | |
sha256sum *.pkg.tar.* >> "$GITHUB_OUTPUT" | |
echo "$EOF" >> "$GITHUB_OUTPUT" | |
echo date=$(date -I | sed s/-//g) >> "$GITHUB_OUTPUT" | |
- name: Push to GitHub Releases | |
if: github.event_name == 'push' | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: false | |
generate_release_notes: true | |
prerelease: false | |
tag_name: ${{ steps.release-info.outputs.date }} | |
files: "out/*.pkg.tar.*" | |
name: Raspberry Pi 4 UEFI Boot Packages for Arch Based Linux Distribution | |
body: | | |
CI Build for commit ${{ github.sha }} | |
sha256sums: | |
``` | |
${{ steps.release-info.outputs.sums }} | |
``` |