diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d4c06c5..589a5cc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,15 +1,11 @@ name: build on: - pull_request: - paths: - - "srcpkgs/**" - types: - - opened - - reopened - - synchronize - branches: - - main + # a package changed (usually in PR) + workflow_run: + workflows: [ChecksumUpdate] + types: [completed] + # we are integrating updates push: paths: - "srcpkgs/**" @@ -17,51 +13,24 @@ on: - main jobs: - checksum: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ github.ref }} - - - name: get changed package - run: | - echo "CHANGED_PKG=$(git diff --name-only origin/main ${GITHUB_HEAD_REF} "srcpkgs/*/template" | head -1 | cut -d/ -f2)" >> $GITHUB_ENV - - - name: checkout upstream templates - if: ${{ env.CHANGED_PKG != '' }} - uses: actions/checkout@v4 - with: - repository: void-linux/void-packages - ref: master - fetch-depth: 1 - path: distdir - - - name: generate checksum - if: ${{ env.CHANGED_PKG != '' }} - run: | - XBPS_DISTDIR="$PWD/distdir" xgensum -i ${{ env.CHANGED_PKG }} - - - name: Commit - if: ${{ env.CHANGED_PKG != '' }} - uses: stefanzweifel/git-auto-commit-action@v6 - with: - file_pattern: "*/template" - commit_message: "Update checksum" - changedpkgs: name: Check package changes - needs: [checksum] runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')" + if: "${{ github.event.workflow_run.conclusion == 'success' }} && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')" outputs: changed: ${{ steps.grabchanged.outputs.changed }} steps: + - name: checkout local templates from prev workflow + if: "${{ github.event_name == 'workflow_run' }}" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.workflow_run.head_branch }} + - name: checkout local templates + if: "${{ github.event_name != 'workflow_run' }}" uses: actions/checkout@v4 with: fetch-depth: 0 @@ -100,7 +69,7 @@ jobs: # - { arch: aarch64-musl, host: x86_64-musl, libc: musl, platform: linux/amd64, test: 0 } container: - image: ghcr.io/void-linux/void-${{ matrix.config.libc }}-full:20250227R1 + image: ghcr.io/void-linux/void-${{ matrix.config.libc }}-full:latest options: --platform ${{ matrix.config.platform }} --privileged volumes: - /dev:/dev @@ -147,7 +116,7 @@ jobs: - name: Find changed templates env: CHANGED: ${{ needs.changedpkgs.outputs.changed }} - run: sudo -Eu builder echo "$CHANGED" | sed 's/ /\n/g' > /tmp/templates + run: sudo -Eu builder echo "${{ env.CHANGED }}" | sed 's/ /\n/g' > /tmp/templates - name: Build and check packages run: sudo -Eu builder common/travis/build.sh "$BOOTSTRAP" "$ARCH" "$TEST" @@ -157,8 +126,10 @@ jobs: - name: Archive xbps artifacts uses: actions/upload-artifact@v4 + env: + CHANGED: ${{ needs.changedpkgs.outputs.changed }} with: - name: binaries-${{ matrix.config.arch }}-${{ matrix.config.libc }} + name: binaries-${{ env.CHANGED }}-${{ matrix.config.arch }}-${{ matrix.config.libc }}.xbps path: | hostdir/binpkgs/*.xbps @@ -187,10 +158,10 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-deployment cancel-in-progress: false - if: "github.ref == 'refs/heads/main' && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')" + if: "github.ref == 'refs/heads/main' && github.event_name != 'workflow_run' && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')" container: - image: ghcr.io/void-linux/void-glibc-full:20250227R1 + image: ghcr.io/void-linux/void-glibc-full:latest options: --privileged steps: @@ -230,6 +201,13 @@ jobs: run: | xbps-rindex --add $PWD/*.xbps xbps-rindex --clean $PWD + xbps-rindex --remove $PWD + + - name: Commit new repo state + uses: stefanzweifel/git-auto-commit-action@v6 + with: + file_pattern: "*.xbps *.xbps.sig2" + commit_message: "Update package repo" # - name: checksum # run: | diff --git a/.github/workflows/checksum.yaml b/.github/workflows/checksum.yaml new file mode 100644 index 0000000..fc0614f --- /dev/null +++ b/.github/workflows/checksum.yaml @@ -0,0 +1,79 @@ +name: ChecksumUpdate + +on: + pull_request: + paths: + - "srcpkgs/**" + types: + - opened + - synchronize + branches: + - main + +jobs: + checksum: + runs-on: ubuntu-latest + container: + image: ghcr.io/void-linux/void-glibc-full:latest + options: --platform linux/amd64 --privileged + volumes: + - /dev:/dev + env: + ARCH: x86_64 + BOOTSTRAP: x86_64 + TEST: 1 + + steps: + - name: Prepare container + run: | + # switch to repo-ci mirror + 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 + # install dependencies + xbps-install -Suy xbps && xbps-install -Suy sudo xtools bash git + # create non-root user + useradd -G xbuilder -M builder + + - name: checkout local templates + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.ref }} + + - name: remember changed package + run: | + git config --global --add safe.directory $PWD + echo "CHANGED_PKG=$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} "srcpkgs/*/template" | head -1 | cut -d/ -f2)" >> $GITHUB_ENV + echo "CHANGED: ${{ env.CHANGED_PKG }}" + + - name: checkout upstream templates + uses: actions/checkout@v4 + with: + repository: void-linux/void-packages + ref: master + fetch-depth: 1 + path: upstream + + - name: prep masterdir + working-directory: upstream + run: | + chown -R builder:builder . && + sudo -Eu builder common/travis/set_mirror.sh && + sudo -Eu builder common/travis/prepare.sh + + - name: copy to upstream + run: cp -rv srcpkgs/* upstream/srcpkgs + + - name: generate checksum + working-directory: upstream + run: "sudo -Eu builder xgensum -f -i ${{ env.CHANGED_PKG }}" + + - name: receive relevant copy from upstream + run: | + cp -r "upstream/srcpkgs/${{ env.CHANGED_PKG }}" srcpkgs + + - name: commit new checksum + uses: stefanzweifel/git-auto-commit-action@v6 + with: + file_pattern: "srcpkgs/${{ env.CHANGED_PKG }}/template" + commit_message: "Update ${{ env.CHANGED_PKG }} checksum" diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 61ced21..54fbe14 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -1,10 +1,7 @@ -name: renovate +name: Check package updates on: schedule: - cron: "0 * * * *" - push: - paths: - - ".github/**" # TODO: remove after debugging env: LOG_LEVEL: "info" diff --git a/srcpkgs/ripgrep-all/template b/srcpkgs/ripgrep-all/template index 2f435c4..c5eec16 100644 --- a/srcpkgs/ripgrep-all/template +++ b/srcpkgs/ripgrep-all/template @@ -1,6 +1,6 @@ # Template file for 'ripgrep-all' pkgname=ripgrep-all -version=0.10.6 # renovate: datasource=github-tags depName=phiresky/ripgrep-all +version=0.10.9 # renovate: datasource=github-tags depName=phiresky/ripgrep-all revision=2 build_style=cargo hostmakedepends="rust pkg-config" @@ -13,7 +13,7 @@ maintainer="Marty Oehme " license="AGPL-3.0-only" homepage="https://github.com/phiresky/ripgrep-all" distfiles="${homepage}/archive/v${version}.tar.gz" -checksum=06cd619ad6638be206266a77fdf11034dc2dc15d97b3a057b0d6280a17334680 +checksum=a5b3150940dcddd35a26e9de398f11a563d0466a335e5450ceb7ff369e9fef45 post_install() { vdoc README.md