attempt build

This commit is contained in:
Antoine Martin 2024-08-11 17:33:12 -04:00
parent 71d71b3b2f
commit 9ba3edc22d
Signed by: forge
GPG key ID: D62A472A4AA7D541
2 changed files with 82 additions and 0 deletions

View file

@ -0,0 +1,56 @@
diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh
old mode 100644
new mode 100755
index c3b8f7a..a54e88c
--- a/usr/local/bin/build.sh.orig
+++ b/usr/local/bin/build.sh
@@ -7,13 +7,15 @@
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
-readonly REPOS="main community testing non-free"
+readonly REPOS="backports user"
+readonly ALPINE_REPOS="main community testing"
readonly ARCH=$(apk --print-arch)
# gitlab variables
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
: "${REPODEST:=$HOME/packages}"
-: "${MIRROR:=https://dl-cdn.alpinelinux.org/alpine}"
+: "${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:=}"
@@ -68,8 +70,8 @@ report() {
get_release() {
case $BASEBRANCH in
- *-stable) echo v"${BASEBRANCH%-*}";;
- master) echo edge;;
+ v*) echo v"${BASEBRANCH%-*}";;
+ edge) echo edge;;
*) die "Branch \"$BASEBRANCH\" not supported!"
esac
}
@@ -101,7 +103,7 @@ set_repositories_for() {
release=$(get_release)
for repo in $REPOS; do
[ "$repo" = "non-free" ] && continue
- [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue
repos="$repos $MIRROR/$release/$repo $REPODEST/$repo"
[ "$repo" = "$target_repo" ] && break
done
@@ -118,7 +120,10 @@ apply_offset_limit() {
}
setup_system() {
- doas sh -c "echo $MIRROR/$(get_release)/main > /etc/apk/repositories"
+ for repo in $ALPINE_REPOS; do
+ [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ repos="$repos $ALPINE_MIRROR/$release/$repo"
+ done
doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system"
abuild-keygen -ain
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf

View file

@ -19,3 +19,29 @@ jobs:
with:
fetch-depth: 500
- run: lint
continue-on-error: true
build-x86_64:
run-name: Build on x86_64
runs-on: x86_64
container:
image: alpinelinux/alpine-gitlab-ci:latest
env:
CI_PROJECT_DIR: ${{ github.workspace }}
CI_DEBUG_BUILD: ${{ runner.debug }}
CI_MERGE_REQUEST_PROJECT_URL: ${{ github.server_url }}/${{ github.repository }}
CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.base_ref }}
steps:
- run: doas apk add nodejs git patch
- uses: actions/checkout@v4
with:
fetch-depth: 500
- run: doas patch -d / -p1 -i ${{ github.workspace }}/.forgejo/patches/build.patch
- run: build.sh
- name: Upload math result for job 1
uses: actions/upload-artifact@v4
with:
name: package
path:
- packages/
- keys /