builder #624
This file contains hidden or 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: builder | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
- cron: '00 6 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: merge upstream | |
run: | | |
git remote add upstream https://github.com/apache/httpd.git | |
git fetch upstream | |
git -c user.name=Github -c user.email=none merge upstream/trunk | |
- name: Cache ccache | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/.cache/ccache | |
key: ccache | |
- name: Prepare build environment | |
run: | | |
sudo DEBIAN_FRONTEND=noninteractive apt -U install -y --no-install-recommends sbuild mmdebstrap debian-archive-keyring ccache uidmap autopkgtest podman passt dbus-user-session | |
mkdir -p "$HOME/.cache/sbuild" | |
mmdebstrap --variant=buildd --include=apt,ccache,ca-certificates \ | |
--keyring=/usr/share/keyrings/debian-archive-keyring.gpg \ | |
--customize-hook='chroot "$1" update-ccache-symlinks' \ | |
testing "$HOME/.cache/sbuild/testing-amd64.tar" | |
autopkgtest-build-podman --init=systemd --release testing -t debian-testing --post-command="apt install -y ca-certificates" | |
ccache --zero-stats --max-size=10.0G | |
chmod a+X "$HOME" "$HOME/.cache" | |
chmod -R a+rwX "$HOME/.cache/ccache" | |
cat << "EOF" > "$HOME/.sbuildrc" | |
$build_environment = { "CCACHE_DIR" => "/build/ccache" }; | |
$path = "/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"; | |
$build_path = "/build/package/"; | |
$dsc_dir = "package"; | |
$unshare_bind_mounts = [ { directory => "$HOME/.cache/ccache", mountpoint => "/build/ccache" } ]; | |
$verbose = 1; | |
$run_autopkgtest = 1; | |
$autopkgtest_root_args = 'PATH=/usr/sbin:/usr/bin:/sbin:/bin'; | |
$autopkgtest_opts = ['--apt-upgrade', '--add-apt-source=deb [trusted=yes] https://github.com/defo-project/openssl/raw/packages/ /', '--', 'podman', '--init', 'debian-testing']; | |
$autopkgtest_require_success = 1; | |
EOF | |
mkdir "$HOME/apt_repo" | |
- name: Run sbuild | |
run: | | |
sed -i "1 s/([^)]*)/(1:$(git describe --tags | sed 's/^[^0-9]*//;s/-/./g;s/_/./g')-$(date -u '+%Y%m%d.%H%M%S%N'))/" debian/changelog | |
sbuild -d testing --chroot-mode=unshare --no-clean-source --no-run-lintian \ | |
--extra-repository="deb [trusted=yes] https://github.com/defo-project/openssl/raw/packages/ ./" \ | |
--dpkg-source-opts="-Zgzip -z1 --format=1.0 -sn" --build-dir="$HOME/apt_repo" | |
cd "$HOME/apt_repo" | |
apt-ftparchive packages . > Packages | |
apt-ftparchive release . > Release | |
- name: Upload apt repository | |
run: | | |
cd "$HOME/apt_repo" | |
BRANCH=packages | |
REPOSITORY="$(printf "%s" "$GITHUB_REPOSITORY" | tr / _)" | |
echo "echo \"deb [trusted=yes] $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/raw/$BRANCH/ /\" | sudo tee /etc/apt/sources.list.d/$REPOSITORY.list" >> README.md | |
git init -b "$BRANCH" | |
git remote add origin "$(echo "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" | sed "s#https://#https://x-access-token:${{ secrets.GITHUB_TOKEN }}@#")" | |
git add . | |
git -c user.name=Github -c user.email=none commit --message="Generated with $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | |
git push --force origin "$BRANCH" |