Compare commits

..

3 commits

7 changed files with 48 additions and 19 deletions

View file

@ -13,4 +13,4 @@ shellcheck -s ash \
-e SC2030 \
-e SC2031 \
-e SC1090 \
-xa $CI_PROJECT_DIR/.gitlab/bin/APKBUILD_SHIM
-xa $GITHUB_WORKSPACE/.gitlab/bin/APKBUILD_SHIM

View file

@ -1,23 +1,23 @@
#!/bin/sh
# shellcheck disable=SC3043
. $CI_PROJECT_DIR/.gitlab/bin/functions.sh
. $GITHUB_WORKSPACE/.gitlab/bin/functions.sh
# shellcheck disable=SC3040
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
readonly APORTSDIR=$GITHUB_WORKSPACE
readonly REPOS="cross backports user testing community"
readonly ALPINE_REPOS="main community"
readonly ARCH=$(apk --print-arch)
# gitlab variables
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
readonly BASEBRANCH=$GITHUB_BASE_REF
: "${REPODEST:=$HOME/packages}"
: "${MIRROR:=https://lab.ilot.io/ayakael/repo-apk/-/raw}"
: "${ALPINE_MIRROR:=http://dl-cdn.alpinelinux.org/alpine}"
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
: "${CI_DEBUG_BUILD:=}"
: "${RUNNER_DEBUG:=}"
: "${CI_ALPINE_BUILD_OFFSET:=0}"
: "${CI_ALPINE_BUILD_LIMIT:=9999}"
@ -42,7 +42,7 @@ verbose() {
}
debugging() {
[ -n "$CI_DEBUG_BUILD" ]
[ -n "$RUNNER_DEBUG" ]
}
debug() {
@ -152,7 +152,7 @@ setup_system() {
sudo cp $HOME/.abuild/$ABUILD_KEY_NAME.rsa.pub /etc/apk/keys/$ABUILD_KEY_NAME.rsa.pub
# patch abuild for crosscompiling
sudo patch -p1 -d / -i $CI_PROJECT_DIR/.gitlab/patches/abuild-cross.patch
sudo patch -p1 -d / -i $GITHUB_WORKSPACE/.gitlab/patches/abuild-cross.patch
sudo sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf
( . /etc/abuild.conf && echo "Building with $JOBS jobs" )
@ -208,7 +208,7 @@ sudo chown -R $USER: .
fetch_flags="-qn"
debugging && fetch_flags="-v"
git fetch $fetch_flags "$CI_MERGE_REQUEST_PROJECT_URL" \
git fetch $fetch_flags "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
"+refs/heads/$BASEBRANCH:refs/heads/$BASEBRANCH"
if debugging; then

View file

@ -14,7 +14,7 @@ basebranch=$1
if ! git rev-parse --verify --quiet $basebranch >/dev/null; then
# The base branch does not eixst, probably due to a shallow clone
git fetch -v $CI_MERGE_REQUEST_PROJECT_URL.git +refs/heads/$basebranch:refs/heads/$basebranch
git fetch -v $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git +refs/heads/$basebranch:refs/heads/$basebranch
fi
git --no-pager diff --diff-filter=ACMR --name-only $basebranch...HEAD -- "*/APKBUILD" | xargs -r -n1 dirname

View file

@ -4,7 +4,7 @@ BLUE="\e[34m"
MAGENTA="\e[35m"
RESET="\e[0m"
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
readonly BASEBRANCH=$GITHUB_BASE_REF
verbose() {
echo "> " "$@"
@ -13,7 +13,7 @@ verbose() {
}
debugging() {
[ -n "$CI_DEBUG_BUILD" ]
[ -n "$RUNNER_DEBUG" ]
}
debug() {
@ -28,7 +28,7 @@ sudo chown -R gitlab-runner: .
fetch_flags="-qn"
debugging && fetch_flags="-v"
git fetch $fetch_flags "$CI_MERGE_REQUEST_PROJECT_URL" \
git fetch $fetch_flags "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
"+refs/heads/$BASEBRANCH:refs/heads/$BASEBRANCH"
if debugging; then

View file

@ -2,14 +2,14 @@
# shellcheck disable=SC3043
. $CI_PROJECT_DIR/.gitlab/bin/functions.sh
. $GITHUB_WORKSPACE/.gitlab/bin/functions.sh
# shellcheck disable=SC3040
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
readonly APORTSDIR=$GITHUB_WORKSPACE
readonly REPOS="backports user"
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
readonly BASEBRANCH=$GITHUB_BASE_REF
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
@ -38,7 +38,7 @@ for i in $(find packages -type f -name "*.apk"); do
done
fetch_flags="-qn"
git fetch $fetch_flags "$CI_MERGE_REQUEST_PROJECT_URL" \
git fetch $fetch_flags "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
"+refs/heads/$BASEBRANCH:refs/heads/$BASEBRANCH"
for repo in $(changed_repos); do
@ -49,10 +49,9 @@ for repo in $(changed_repos); do
for i in $(find $HOME/repo-apk/$repo -maxdepth 1 -mindepth 1 -printf '%P '); do
CHOST=$i abuild index
done
cd "$CI_PROJECT_DIR"
cd "$GITHUB_WORKSPACE"
rm -R $repo/DUMMY
done
git -C $HOME/repo-apk add .
git -C $HOME/repo-apk commit -m "Update from $CI_MERGE_REQUEST_IID - $CI_MERGE_REQUEST_TITLE"
git -C $HOME/repo-apk annex sync --content

30
action.yml Normal file
View file

@ -0,0 +1,30 @@
jobs:
lint:
run-name: lint
on: pull_request
runs-on: ayakael-podman-x86_64
image: alpine-latest
steps:
- run: |
sudo apk add shellcheck atools sudo abuild
export PATH="$PATH:$GITHUB_WORKSPACE/.gitlab/bin"
lint
continue-on-error: true
build-x86_64:
run-name: Build on x86_64
runs-on: ayakael-podman-x86_64
image: alpine-latest
steps:
- run: |
sudo apk add alpine-sdk lua-aports sudo
sudo addgroup $USER abuild
export PATH="$PATH:$GITHUB_WORKSPACE/.gitlab/bin"
sudo -Eu $USER build.sh
- name: Upload math result for job 1
uses: actions/upload-artifact@v4
with:
name: package
path:
- packages/
- keys /

View file

@ -2,7 +2,7 @@
# Maintainer:
pkgname=py3-validators
pkgver=0.20.0
pkgrel=2
pkgrel=3
pkgdesc="Python3 Data Validation for Humans"
url="https://github.com/python-validators/validators"
arch="noarch"