diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 00000000000..55cdd94d80c --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Build/Publish XBPS + +on: + push: + # 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 " + 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 + export XBPS_TARGET_ARCH + packages=$(echo "${{ steps.changed.outputs.all_changed_files }}" | grep -oP '(?<=srcpkgs/)[^/]*' | xargs) + for package in $packages; do + cp -a srcpkgs/${package} /void-packages-master/srcpkgs/ + /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/ + done + + - name: Push packages + run: | + set -xeu + curl -so "/target/${{ env.ARCH }}-repodata" "https://xbps.snaile.de/${{ env.ARCH }}-repodata" + echo '${{ secrets.XBPS_SIGNING_KEY }}' >/tmp/privkey.pem + for package in /target/*; do + [ "$package" = "/target/${{ env.ARCH }}-repodata" ] && continue + xbps-rindex --add "$package" + XBPS_PASSPHRASE=${{ secrets.XBPS_SIGNING_PASSPHRASE }} xbps-rindex --privkey /tmp/privkey.pem --sign-pkg --signedby "${{ env.MAINTAINER }}" "$package" + 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 diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml new file mode 100644 index 00000000000..f6ccf591102 --- /dev/null +++ b/.forgejo/workflows/renovate.yml @@ -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 ' + LOG_LEVEL: debug + + steps: + - uses: https://code.forgejo.org/actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Renovate + run: renovate ${{ github.repository }} diff --git a/.renovaterc.json b/.renovaterc.json index b6a3eb71f93..c246107ef9b 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -32,6 +32,7 @@ } ], "enabledManagers": [ - "custom.regex" + "custom.regex", + "github-actions" ] } diff --git a/.woodpecker/1-renovate.yml b/.woodpecker/1-renovate.yml deleted file mode 100644 index 21cd2d23620..00000000000 --- a/.woodpecker/1-renovate.yml +++ /dev/null @@ -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 - secrets: - - source: github_token - target: github_com_token - - source: gitea_renovate - target: renovate_token - - source: renovate_git_private_key - target: RENOVATE_GIT_PRIVATE_KEY diff --git a/.woodpecker/2-build.yml b/.woodpecker/2-build.yml deleted file mode 100644 index 0be4569ac35..00000000000 --- a/.woodpecker/2-build.yml +++ /dev/null @@ -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