experimental new pipeline

This commit is contained in:
Luca Bilke 2024-04-05 22:14:45 +02:00
parent 856d7ae4b5
commit 57fc136e79
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
5 changed files with 89 additions and 56 deletions

View File

@ -0,0 +1,63 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build/Publish XBPS
on:
push:
branches:
- main
paths-ignore:
- ".forgejo**"
- ".renovaterc.json"
- "README.md"
jobs:
build-and-publish:
runs-on: docker
container: git.snaile.de/snailed/xbps-builder:2024.4.2029
env:
MAINTAINER: "Luca Bilke <luca@bil.ke>"
ARCH: "x86_64"
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
submodules: true
- name: Get changed packages
id: changed
uses: https://github.com/tj-actions/changed-files@v44
with:
since_last_remote_commit: true
- name: Build packages
run: |
set -xeu
packages=$(echo "${{ steps.changed.outputs.all_changed_files }}" | grep -oP '(?<=srcpkgs/)[^/]*' | xargs)
[ -z "${packages}" ] && exit 0
export XBPS_TARGET_ARCH
for package in $packages; do
cp -a "srcpkgs/${package}" "/void-packages-master/srcpkgs/"
/void-packages-master/xbps-src pkg "${package}" >"pkg.log"
mv "/void-packages-master/hostdir/binpkgs/${package}.${{ env.ARCH }}.xbps" "/target/"
done
- name: Push packages
run: |
set -xeu
packages=$(echo "${{ steps.changed.outputs.all_changed_files }}" | grep -oP '(?<=srcpkgs/)[^/]*' | xargs)
[ -z "${packages}" ] && exit 0
curl -so "/target/${{ env.ARCH }}-repodata" "https://xbps.snaile.de/${{ env.ARCH }}-repodata"
echo '${{ secrets.XBPS_SIGNING_KEY }}' >"/tmp/privkey.pem"
for package in $packages; do
file="/target/${package}.${{ env.ARCH }}.xbps"
[ -r "$file" ]
xbps-rindex --add "$file"
XBPS_PASSPHRASE=${{ secrets.XBPS_SIGNING_PASSPHRASE }} xbps-rindex --privkey "/tmp/privkey.pem" --sign-pkg --signedby "${{ env.MAINTAINER }}" "$file"
done
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 {} \;
rm /tmp/privkey.pem

View File

@ -0,0 +1,24 @@
name: Renovate
on:
schedule:
- cron: '0 */12 * * *'
jobs:
renovate:
runs-on: docker
container: renovate/renovate@sha256:328686ec82a09ea7fc4326ac03a35dff926a7e85206d7f1b376d6002e04ef526
env:
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
GITHUB_COM_TOKEN: ${{ secrets.GH_NOPRIV_TOKEN }}
RENOVATE_GIT_PRIVATE_KEY: ${{ secrets.JOHNNY5_GPG_PRIVKEY }}
RENOVATE_PLATFORM: gitea
RENOVATE_ENDPOINT: ${{ github.server_url }}
RENOVATE_GIT_AUTHOR: 'Johnny5 <bot@snaile.de>'
LOG_LEVEL: debug
steps:
- uses: https://code.forgejo.org/actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Renovate
run: renovate ${{ github.repository }}

View File

@ -32,6 +32,7 @@
}
],
"enabledManagers": [
"custom.regex"
"custom.regex",
"github-actions"
]
}

View File

@ -1,21 +0,0 @@
when:
- event: cron
cron: renovate
- event: manual
steps:
renovate:
image: renovate/renovate
commands:
- renovate $${CI_REPO}
environment:
RENOVATE_PLATFORM: ${CI_FORGE_TYPE}
RENOVATE_ENDPOINT: ${CI_FORGE_URL}
RENOVATE_GIT_AUTHOR: Renovate Bot <renovate@snaile.de>
secrets:
- source: github_token
target: github_com_token
- source: gitea_renovate
target: renovate_token
- source: renovate_git_private_key
target: RENOVATE_GIT_PRIVATE_KEY

View File

@ -1,34 +0,0 @@
matrix:
PACKAGE:
- brave-bin
- tidal-hifi-bin
- ferdium-bin
- font-firacode-nf-ttf
- zk
when:
- event: push
evaluate: 'CI_PIPELINE_FILES contains PACKAGE && CI_COMMIT_BRANCH == CI_REPO_DEFAULT_BRANCH'
- event: manual
steps:
package-xbps:
image: git.snaile.de/snailed/xbps-builder:latest
pull: true
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
- cp -a srcpkgs/${PACKAGE} /void-packages-master/srcpkgs/
- /void-packages-master/xbps-src binary-bootstrap
- /void-packages-master/xbps-src pkg ${PACKAGE} > pkg.log
- "packagename=$(cat pkg.log | grep 'index: added' | cut -d '`' -f2 | cut -d \"'\" -f1)"
- mv /void-packages-master/hostdir/binpkgs/$${packagename}.x86_64.xbps /target/
- xbps-rindex -a /target/$${packagename}.x86_64.xbps
- xbps-rindex -S --signedby "$${CI_COMMIT_AUTHOR} <$${CI_COMMIT_AUTHOR_EMAIL}>" --privkey /etc/woodpecker/privkey.pem /target/*.xbps