update CI
Build/Publish XBPS / build-and-publish (push) Successful in 6s Details

This commit is contained in:
Luca Bilke 2024-04-03 22:03:34 +02:00
parent 69a0abafa9
commit 46f870df7d
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
2 changed files with 63 additions and 60 deletions

View File

@ -0,0 +1,63 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build/Publish XBPS
on: [push]
jobs:
build-and-publish:
runs-on: docker
container: git.snaile.de/snailed/xbps-builder:2024.4.843
env:
LICENSE: "GPL-2.0"
SHORT_DESCRIPTION: "Customized dmenu"
DEPENDENCIES: "pango>=1.44,glibc>=2.32,libX11>=1.2,libXft>=2.3.8,libXinerama>=1.0.3,fontconfig>=2.6.0"
MAINTAINER: "Luca Bilke <luca@bil.ke>"
NAME: "dmenu-custom"
ARCH: "x86_64"
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
submodules: true
- name: Generate tag and package name
run: |
set -xeu
MAJOR=$(date +%Y)
MINOR=$(date +%m | sed 's/^0//')
PATCH=$(date +%H%M | sed 's/^0//')
echo "PACKAGE_NAME=${{ env.NAME }}-${MAJOR}.${MINOR}.${PATCH}_1" >> $GITHUB_ENV
- name: Build
run: |
set -xeu
cp -f config.mk patches.h dmenu-flexipatch/
bash flexipatch-finalizer/flexipatch-finalizer.sh -r -d dmenu-flexipatch -o dmenu-final
cp -f config.h dmenu-final/
cd dmenu-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 {} \;

View File

@ -1,60 +0,0 @@
when:
- event: tag
- event: manual
steps:
build:
image: git.snaile.de/snailed/xbps-builder
commands:
- cp -f config.mk patches.h dmenu-flexipatch/
- bash flexipatch-finalizer/flexipatch-finalizer.sh -r -d dmenu-flexipatch -o dmenu-final
- cp -f config.h dmenu-final/
- cd dmenu-final || exit 1
- make clean install DESTDIR="$${CI_WORKSPACE}/pkg" PREFIX="/usr"
package-xbps:
image: ghcr.io/void-linux/void-musl-busybox
environment:
- LICENSE=GPL-2.0
- SHORT_DESCRIPTION=Customized dwm
- DEPENDENCIES=pango>=1.44,glibc>=2.32,libX11>=1.2,libXft>=2.3.8,libXinerama>=1.0.3,fontconfig>=2.6.0
commands: |
xbps-create -A x86_64 \
-H "$${CI_REPO_URL}" \
-l "$${LICENSE}" \
-n "$${CI_REPO_NAME}-$${CI_COMMIT_TAG}_1" \
-m "$${CI_COMMIT_AUTHOR} <$${CI_COMMIT_AUTHOR_EMAIL}>" \
-s "$${SHORT_DESCRIPTION}" \
-D "$${DEPENDENCIES}" \
"$${CI_WORKSPACE}/pkg"
# package-targz:
# image: alpine
# commands:
# - tar czf $${CI_REPO_NAME}-$${CI_COMMIT_TAG}.tar.gz --directory=$${CI_WORKSPACE}/pkg .
#
# publish:
# image: woodpeckerci/plugin-gitea-release
# settings:
# base_url: https://git.snaile.de
# files:
# - "${CI_REPO_NAME}-${CI_COMMIT_TAG}.tar.gz"
# api_key:
# from_secret: gitea_release
# target: main
publish-xbps:
image: ghcr.io/void-linux/void-musl-busybox
environment:
- XBPS_TARGET_ARCH=x86_64
secrets:
- source: xbps_pem_passphrase
target: XBPS_PASSPHRASE
volumes:
- /var/www/xbps:/target
- /etc/woodpecker/:/etc/woodpecker:ro
commands:
- export XBPS_TARGET_ARCH
- mv $${CI_REPO_NAME}-$${CI_COMMIT_TAG}_1.x86_64.xbps /target
- xbps-rindex -a /target/$${CI_REPO_NAME}-$${CI_COMMIT_TAG}_1.x86_64.xbps
- xbps-rindex -S --signedby "$${CI_COMMIT_AUTHOR} <$${CI_COMMIT_AUTHOR_EMAIL}>" --privkey /etc/woodpecker/privkey.pem /target/$${CI_REPO_NAME}-$${CI_COMMIT_TAG}_1.x86_64.xbps