72 lines
2.8 KiB
YAML
72 lines
2.8 KiB
YAML
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
name: Build/Publish XBPS
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- ".forgejo**"
|
|
- ".renovaterc.json"
|
|
- "build.sh"
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: docker
|
|
container: git.snaile.de/snailed/xbps-builder:2024.46.1156@sha256:c69bcb9da724a31d9c1fff36fa6dc8f363b2d9f2470d3ec7887a0905c84b66ea
|
|
env:
|
|
LICENSE: "GPL-2.0"
|
|
SHORT_DESCRIPTION: "Customized st"
|
|
DEPENDENCIES: "freetype>=2.12.1,glibc>=2.32,fontconfig>=2.6.0,libX11>=1.2,libXft>=2.3.8,ncurses>=0"
|
|
MAINTAINER: "Luca Bilke <luca@bil.ke>"
|
|
NAME: "st-custom"
|
|
ARCH: "x86_64"
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://code.forgejo.org/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Generate tag and package name
|
|
run: |
|
|
set -xeu
|
|
MAJOR=$(date +%Y)
|
|
MINOR=$(date +%m%d)
|
|
PATCH=$(date +%H%M)
|
|
echo "PACKAGE_NAME=${{ env.NAME }}-${MAJOR}.${MINOR}.${PATCH}_1" >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
run: |
|
|
set -xeu
|
|
cp -f config.mk Makefile patches.h st-flexipatch/
|
|
flexipatch-finalizer/flexipatch-finalizer.sh -r -d st-flexipatch -o st-final
|
|
for patch in patches/*.diff; do
|
|
patch -d st-final <"$patch"
|
|
done
|
|
cp -f config.h st-final/
|
|
cd st-final && make clean install DESTDIR="${GITHUB_WORKSPACE}/pkg" PREFIX="/usr"
|
|
|
|
- name: Create package
|
|
run : |
|
|
set -xeu
|
|
export XBPS_TARGET_ARCH=${{ env.ARCH }}
|
|
mkdir /target
|
|
cd /target || exit 1
|
|
xbps-create -A ${{ env.ARCH }} \
|
|
-H "${{ github.server_url }}/${{ github.repository }}" \
|
|
-l "${{ env.LICENSE }}" \
|
|
-n "${{ env.PACKAGE_NAME }}" \
|
|
-m "${{ env.MAINTAINER }}" \
|
|
-s "${{ env.SHORT_DESCRIPTION }}" \
|
|
-D "${{ env.DEPENDENCIES }}" \
|
|
"${GITHUB_WORKSPACE}/pkg"
|
|
|
|
- name: Push Package
|
|
run: |
|
|
set -xeu
|
|
curl -so "/target/${{ env.ARCH }}-repodata" "https://xbps.snaile.de/${{ env.ARCH }}-repodata"
|
|
xbps-rindex --add "/target/${{ env.PACKAGE_NAME }}.${{ env.ARCH }}.xbps"
|
|
echo '${{ secrets.XBPS_SIGNING_KEY }}' >/tmp/privkey.pem
|
|
XBPS_PASSPHRASE=${{ secrets.XBPS_SIGNING_PASSPHRASE }} xbps-rindex --privkey /tmp/privkey.pem --sign-pkg --signedby "${{ env.MAINTAINER }}" "/target/${{ env.PACKAGE_NAME }}.${{ env.ARCH }}.xbps"
|
|
rm /tmp/privkey.pem
|
|
ls -lAH /target
|
|
find /target -type f -exec sh -c 'curl -X PUT --digest -u "${{ vars.XBPS_WEBDAV_USER }}:${{ secrets.XBPS_WEBDAV_KEY }}" -T "${1}" "https://xbps.snaile.de/$(basename $1)"' find-shell {} \;
|