Skip to content

gpkg-dev/glibc: fix syscall #834

gpkg-dev/glibc: fix syscall

gpkg-dev/glibc: fix syscall #834

Workflow file for this run

name: build-dev
on:
push:
branches:
- main
paths:
- 'gpkg-dev/**'
pull_request:
paths:
- 'gpkg-dev/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target_arch: [aarch64, arm, x86_64, i686]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Get list gpkg-dev packages
run: |
mkdir -p "pkgs/PKGBUILDs"
if [ ${{ github.event_name }} = "pull_request" ]; then
list=$(curl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s -X GET -G \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | jq -r '.[] | .filename')
else
list=$(curl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s -X GET -G \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}" | jq -r ".files[].filename")
fi
for i in $list; do
il=(${i//// })
if [ "${il[0]}" = "gpkg-dev" ]; then
if [ -d "${il[0]}/${il[1]}" ]; then
if [ ! -f pkgs/gpkg-dev-need.txt ] || ! $(grep -q '^'${il[1]}'$' pkgs/gpkg-dev-need.txt); then
echo "${il[1]}" >> pkgs/gpkg-dev-need.txt
curl -L "https://raw.githubusercontent.com/termux-pacman/glibc-packages/$(git log -n 2 --format=format:%H gpkg-dev/${il[1]} | tail -1)/gpkg-dev/${il[1]}/PKGBUILD" -o pkgs/PKGBUILDs/${il[1]}
fi
else
echo "${il[1]}" >> pkgs/deleted_gpkg-dev_packages.txt
fi
fi
done
- name: Build gpkg-dev packages
run: |
for i in $(cat "pkgs/gpkg-dev-need.txt"); do
./script/docker.sh /home/user-build/script/build-dev.sh ${{ matrix.target_arch }} ${i}
done
tar cJf gpkg-dev-${{ matrix.target_arch }}.tar.xz pkgs
- uses: actions/upload-artifact@v3
with:
name: gpkg-dev-${{ matrix.target_arch }}
path: "./gpkg-dev-${{ matrix.target_arch }}.tar.xz"
if-no-files-found: error
upload:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, arm, x86_64, i686]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Get packages
uses: actions/download-artifact@v3
with:
path: ./
- name: Install aws-cli
run: |
git clone https://github.com/termux-pacman/aws-cli-action.git
./aws-cli-action/setup.sh '${{ secrets.AWS_ACCESS_KEY_ID }}' '${{ secrets.AWS_ACCESS_KEY }}' '${{ secrets.AWS_REGION }}'
- name: Import GPG key
run: |
echo '${{ secrets.SF_GPG_BOT }}' > key.gpg
gpg --pinentry-mode=loopback --passphrase '${{ secrets.PW_GPG_BOT }}' --import key.gpg > /dev/null
rm key.gpg
- name: Uploading packages to aws
run: |
sfuf() {
gpg --batch --pinentry-mode=loopback --passphrase '${{ secrets.PW_GPG_BOT }}' --detach-sign --use-agent -u '${{ secrets.KEY_GPG_BOT }}' --no-armor "$1"
for format_file in "" ".sig"; do
aws s3 cp "${1}${format_file}" s3://'${{ secrets.SFPU }}'/gpkg-dev/${{ matrix.arch }}/"${1##*/}${format_file}"
done
}
tar xJf gpkg-dev-${{ matrix.arch }}/gpkg-dev-${{ matrix.arch }}.tar.xz
dp_file="deleted_gpkg-dev_packages.txt"
if [[ -f pkgs/$dp_file ]]; then
path_dp_file=pkgs/${{ github.sha }}_${dp_file}
mv pkgs/${dp_file} ${path_dp_file}
sfuf "${path_dp_file}"
fi
for pkg in $(ls pkgs/*.pkg.* 2> /dev/null); do
sfuf "$pkg"
done
rm -fr pkgs