image: alpine/latest packages: - coreutils - procps - py3-requests sources: - "https://gitlab.com/postmarketOS/pmaports.git/" - "https://gitlab.com/postmarketOS/pmbootstrap.git/" - "https://gitlab.com/postmarketOS/build.postmarketos.org.git/" environment: BPO_TOKEN_FILE: "/home/build/.token" BPO_API_HOST: https://build.postmarketos.org BPO_JOB_NAME: sign_index BPO_WIP_REPO_URL: https://build.postmarketos.org/wip/ BPO_WIP_REPO_ARG: '-mp http://build.postmarketos.org/wip/' secrets: - 482975ec-22f7-49fd-9b54-486b0b1947c3 - 18f0a302-e8ac-4cc6-80ec-479d5e8e0bee triggers: - action: webhook condition: failure url: https://build.postmarketos.org/api/public/update-job-status tasks: - bpo_setup: | export BPO_JOB_ID="$JOB_ID" # Switch branch and release channel mkdir -p ~/.config ( echo "[pmbootstrap]" echo "is_default_channel = False" ) > ~/.config/pmbootstrap.cfg git -C pmaports checkout v20.05 yes "" | ./pmbootstrap/pmbootstrap.py --aports=$PWD/pmaports -q init sudo modprobe binfmt_misc sudo mount -t binfmt_misc none /proc/sys/fs/binfmt_misc branch="$(git -C pmaports rev-parse --abbrev-ref HEAD)" if [ "$branch" != v20.05 ]; then echo "ERROR: pmbootstrap switched to the wrong branch: $branch" exit 1 fi - download_unsigned_index: | export BPO_JOB_ID="$JOB_ID" if [ -n "$BPO_WIP_REPO_PATH" ]; then cp "$BPO_WIP_REPO_PATH"/v20.05/aarch64/APKINDEX-symlink-repo.tar.gz \ APKINDEX.tar.gz else wget "$BPO_WIP_REPO_URL"/v20.05/aarch64/APKINDEX-symlink-repo.tar.gz \ -O APKINDEX.tar.gz fi - sign: | export BPO_JOB_ID="$JOB_ID" ./pmbootstrap/pmbootstrap.py \ --aports=$PWD/pmaports \ --no-ccache \ build_init work_dir="$(./pmbootstrap/pmbootstrap.py -q config work)" chroot_target="$work_dir/chroot_native/home/pmos/" sudo cp APKINDEX.tar.gz "$chroot_target" sudo cp .final.rsa "$chroot_target"/build.postmarketos.org.rsa sudo chown -R 12345 "$chroot_target" ./pmbootstrap/pmbootstrap.py \ --aports=$PWD/pmaports \ --details-to-stdout \ chroot --user -- \ abuild-sign \ -k /home/pmos/build.postmarketos.org.rsa \ /home/pmos/APKINDEX.tar.gz sudo mv "$chroot_target/APKINDEX.tar.gz" . - upload: | export BPO_JOB_ID="$JOB_ID" export BPO_API_ENDPOINT="sign-index" export BPO_ARCH=aarch64 export BPO_BRANCH=v20.05 export BPO_PAYLOAD_FILES="APKINDEX.tar.gz" export BPO_PAYLOAD_IS_JSON="0" export BPO_PKGNAME="" export BPO_VERSION="" # Always run submit.py with exec, because when running locally, the # current_task.sh script can change before submit.py completes! exec build.postmarketos.org/helpers/submit.py