4 Commits

Author SHA1 Message Date
Ivan Gabaldon
cd64fb966e [enh] container: support multiple registries
Allows to push the manifests to other registries, this allows to push both docker.io and ghcr.io registries.
2025-05-15 11:37:18 +02:00
Ivan Gabaldon
743f24d8c6 [fix] CI: commit author should be searxng-bot
If the workflow is executed with the "workflow_dispatch" trigger, the user who executed the workflow becomes the author of the commit on the PR, this is not intended.

It also reverts the body param so that the default text of the action does not appear.
2025-05-15 11:19:28 +02:00
Ivan Gabaldon
bec76bc2e3 [fix] CI: prevent race condition
`checker.yml` and `integration.yml` are the only workflows that are currently safe to be executed simultaneously, the others present a risk that the order of completion may not be expected. The ones that are chained from `integration.yml` can be called as many times as `integration.yml` workflows are running at that moment, the same with the trigger "workflow_dispatch".

This can be fatal for workflows like `container.yml` that use a centralized cache to store and load the candidate images in a common tag called "searxng-<arch>".

* For example, a `container.yml` workflow is executed after being chained from `integration.yml` (called "~1"), and seconds later it may be triggered again because another PR merged some breaking changes (called "~2"). While "~1" has already passed the test job successfully and is about to start the release job, "~2" finishes building the container and overwrites the references on the common tag. When "~1" in the release job loads the images using the common tag, it will load the container of "~2" instead of "~1" having skipped the whole test job process.

The example is only set for the container workflow, but the other workflows might occur in a similar way.
2025-05-15 11:19:28 +02:00
Ivan Gabaldon
d0b7f26f4b [fix] CI: container-mounts bad hash
This is a typo, but if there are multiple patterns in hashFiles, they should be separated by commas.

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#examples-with-multiple-patterns
2025-05-15 11:19:28 +02:00
7 changed files with 29 additions and 21 deletions

View File

@@ -8,7 +8,7 @@ on:
- cron: "0 4 * * 5"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:

View File

@@ -13,7 +13,7 @@ on:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
@@ -76,7 +76,7 @@ jobs:
uses: actions/cache@v4
with:
# yamllint disable-line rule:line-length
key: "container-mounts-${{ matrix.arch }}-${{ hashFiles('./container/Dockerfile ./container/legacy/Dockerfile') }}"
key: "container-mounts-${{ matrix.arch }}-${{ hashFiles('./container/Dockerfile', './container/legacy/Dockerfile') }}"
restore-keys: "container-mounts-${{ matrix.arch }}-"
path: |
/var/tmp/buildah-cache/
@@ -117,10 +117,6 @@ jobs:
os: ubuntu-24.04-arm
emulation: true
permissions:
# Organization GHCR
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -152,6 +148,10 @@ jobs:
- build
- test
permissions:
# Organization GHCR
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

View File

@@ -8,7 +8,7 @@ on:
- cron: "59 23 28 * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
@@ -66,7 +66,7 @@ jobs:
id: cpr
uses: peter-evans/create-pull-request@v7
with:
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
author: "searxng-bot <searxng-bot@users.noreply.github.com>"
committer: "searxng-bot <searxng-bot@users.noreply.github.com>"
title: "[data] update searx.data - ${{ matrix.fetch }}"
commit-message: "[data] update searx.data - ${{ matrix.fetch }}"
@@ -74,6 +74,8 @@ jobs:
delete-branch: "true"
draft: "false"
signoff: "false"
body: |
[data] update searx.data - ${{ matrix.fetch }}
labels: |
data

View File

@@ -12,7 +12,7 @@ on:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:

View File

@@ -15,7 +15,7 @@ on:
- cron: "05 07 * * 5"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
@@ -119,7 +119,7 @@ jobs:
id: cpr
uses: peter-evans/create-pull-request@v7
with:
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
author: "searxng-bot <searxng-bot@users.noreply.github.com>"
committer: "searxng-bot <searxng-bot@users.noreply.github.com>"
title: "[l10n] update translations from Weblate"
commit-message: "[l10n] update translations from Weblate"
@@ -127,6 +127,8 @@ jobs:
delete-branch: "true"
draft: "false"
signoff: "false"
body: |
[l10n] update translations from Weblate
labels: |
translation

View File

@@ -8,7 +8,7 @@ on:
- cron: "42 05 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:

View File

@@ -255,8 +255,7 @@ container.push() {
done
# Manifest tags
release_tags=("latest")
release_tags+=("$DOCKER_TAG")
release_tags=("latest" "$DOCKER_TAG")
# Create manifests
for tag in "${release_tags[@]}"; do
@@ -274,13 +273,18 @@ container.push() {
podman image list
# Remote registries
release_registries=("ghcr.io" "docker.io")
# Push manifests
for registry in "${release_registries[@]}"; do
for tag in "${release_tags[@]}"; do
build_msg CONTAINER "Pushing manifest with tag: $tag"
build_msg CONTAINER "Pushing manifest $tag to $registry"
podman manifest push \
"localhost/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag" \
"docker://docker.io/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag"
"docker://$registry/$CONTAINER_IMAGE_ORGANIZATION/$CONTAINER_IMAGE_NAME:$tag"
done
done
)
dump_return $?