2024-05-21 18:28:51 +02:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
name: Build/Publish XBPS
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-05-21 18:44:39 +02:00
|
|
|
- "master"
|
2024-05-21 18:28:51 +02:00
|
|
|
paths:
|
2024-05-22 10:40:31 +02:00
|
|
|
- "srcpkgs/zk/**"
|
2024-05-22 18:57:48 +02:00
|
|
|
- "srcpkgs/dmenu-custom/**"
|
|
|
|
- "srcpkgs/dwm-custom/**"
|
|
|
|
- "srcpkgs/st-custom/**"
|
|
|
|
- "srcpkgs/dwmblocks-custom/**"
|
2024-05-21 18:28:51 +02:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-publish:
|
|
|
|
name: Build and publish packages
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: "!contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')"
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- arch: x86_64
|
|
|
|
host: x86_64
|
|
|
|
libc: glibc
|
|
|
|
platform: linux/amd64
|
|
|
|
- arch: x86_64-musl
|
|
|
|
host: x86_64-musl
|
|
|
|
libc: musl
|
|
|
|
platform: linux/amd64
|
|
|
|
- arch: aarch64-musl
|
|
|
|
host: x86_64-musl
|
|
|
|
libc: musl
|
|
|
|
platform: linux/amd64
|
2024-05-21 21:41:35 +02:00
|
|
|
# - arch: i686
|
|
|
|
# host: i686
|
|
|
|
# libc: glibc
|
|
|
|
# platform: linux/386
|
|
|
|
# - arch: aarch64
|
|
|
|
# host: x86_64
|
|
|
|
# libc: glibc
|
|
|
|
# platform: linux/amd64
|
|
|
|
# - arch: armv7l
|
|
|
|
# host: x86_64
|
|
|
|
# libc: glibc
|
|
|
|
# platform: linux/amd64
|
|
|
|
# - arch: armv6l-musl
|
|
|
|
# host: x86_64-musl
|
|
|
|
# libc: musl
|
|
|
|
# platform: linux/amd64
|
|
|
|
# - arch: aarch64-musl
|
|
|
|
# host: x86_64-musl
|
|
|
|
# libc: musl
|
|
|
|
# platform: linux/amd64
|
2024-05-21 20:55:09 +02:00
|
|
|
env:
|
|
|
|
MAINTAINER: "Luca Bilke <luca@bil.ke>"
|
|
|
|
PATH: "/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin"
|
|
|
|
ARCH: "${{ matrix.config.arch }}"
|
|
|
|
BOOTSTRAP: "${{ matrix.config.host }}"
|
|
|
|
HOSTREPO: /hostrepo
|
2024-05-21 18:28:51 +02:00
|
|
|
container:
|
2024-05-21 20:55:09 +02:00
|
|
|
image: git.snaile.de/snailed/xbps-builder:${{ matrix.config.libc }}-latest
|
2024-05-21 18:28:51 +02:00
|
|
|
steps:
|
2024-05-21 18:44:39 +02:00
|
|
|
- name: Clone and checkout
|
2024-05-21 22:09:33 +02:00
|
|
|
uses: https://github.com/classabbyamp/treeless-checkout-action@bd3615a6e9d5546151e17d72193eea0d6f297398 # v1
|
2024-05-21 18:28:51 +02:00
|
|
|
|
|
|
|
- name: Prepare container
|
|
|
|
run: |
|
|
|
|
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
|
|
|
|
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
|
2024-05-21 18:44:39 +02:00
|
|
|
xbps-install -Syu || { xbps-install -yu xbps && xbps-install -yu; }
|
2024-05-21 19:24:11 +02:00
|
|
|
xbps-install -y grep curl git
|
2024-05-21 18:28:51 +02:00
|
|
|
|
|
|
|
- name: Create hostrepo and prepare masterdir
|
|
|
|
run: |
|
|
|
|
ln -s "$(pwd)" /hostrepo &&
|
|
|
|
common/travis/set_mirror.sh &&
|
|
|
|
common/travis/prepare.sh &&
|
|
|
|
common/travis/fetch-xtools.sh
|
|
|
|
mkdir -p /hostdir/binpkgs
|
|
|
|
curl -so "/hostdir/binpkgs/${{ matrix.config.arch }}-repodata" "https://xbps.snaile.de/${{ matrix.config.arch }}-repodata" || true
|
|
|
|
|
2024-05-21 19:24:11 +02:00
|
|
|
- name: Get changed packages
|
|
|
|
run: |
|
|
|
|
tip="$(git rev-list -1 --parents HEAD)"
|
|
|
|
case "$tip" in
|
|
|
|
# This is a merge commit, pick last parent
|
|
|
|
*" "*" "*) tip="${tip##* }" ;;
|
|
|
|
# This is a non-merge commit, pick itself
|
|
|
|
*) tip="${tip%% *}" ;;
|
|
|
|
esac
|
|
|
|
base="$(git rev-list -1 HEAD^)"
|
|
|
|
|
|
|
|
echo "$base $tip" >/tmp/revisions
|
|
|
|
|
|
|
|
echo -e '\x1b[32mChanged packages:\x1b[0m'
|
|
|
|
|
|
|
|
git diff-tree -r --no-renames --name-only --diff-filter=AM \
|
|
|
|
"$base" "$tip" \
|
|
|
|
-- 'srcpkgs/*/template' |
|
|
|
|
cut -d/ -f 2 |
|
|
|
|
xargs ./xbps-src sort-dependencies |
|
|
|
|
tee /tmp/templates |
|
|
|
|
sed "s/^/ /" >&2
|
|
|
|
|
2024-05-21 18:28:51 +02:00
|
|
|
- name: Build packages
|
|
|
|
run: |
|
|
|
|
(
|
|
|
|
here="$(pwd)"
|
|
|
|
cd /
|
2024-05-21 21:20:02 +02:00
|
|
|
"$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" 0
|
2024-05-21 18:28:51 +02:00
|
|
|
)
|
|
|
|
|
2024-05-21 18:44:39 +02:00
|
|
|
- name: Sign and upload packages
|
2024-05-21 18:28:51 +02:00
|
|
|
run: |
|
|
|
|
echo '${{ secrets.XBPS_SIGNING_KEY }}' >"/tmp/privkey.pem"
|
|
|
|
|
2024-05-21 21:20:02 +02:00
|
|
|
for package in $(echo "$HOME"/hostdir/binpkgs/*.${{ matrix.config.arch }}.xbps | cut -d ' ' -f 1); do
|
2024-05-21 18:44:39 +02:00
|
|
|
XBPS_PASSPHRASE=${{ secrets.XBPS_SIGNING_PASSPHRASE }} xbps-rindex --privkey "/tmp/privkey.pem" --sign-pkg --signedby "${{ env.MAINTAINER }}" "$package"
|
|
|
|
for item in "$package" "${package}.sig2"; do
|
|
|
|
curl -X PUT --digest -u "${{ vars.XBPS_WEBDAV_USER }}:${{ secrets.XBPS_WEBDAV_KEY }}" -T "${item}" "https://xbps.snaile.de/$(basename $item)"
|
|
|
|
done
|
2024-05-21 18:28:51 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
rm /tmp/privkey.pem
|