Support logging to the journal with priority "notice" (#763) #401
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update translations and Rust packaging related files in main | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- debian/control | |
concurrency: auto-update | |
permissions: | |
pull-requests: write | |
contents: write | |
# Jobs in this action must not run concurrently, as they modify the repository. | |
# When adding more jobs, make sure to use the "needs:" attribute to make sure they run sequentially. | |
jobs: | |
update-rust-packaging: | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: [main] | |
ubuntu-version: [devel] | |
include: | |
- branch: noble | |
ubuntu-version: noble | |
name: Update ${{ matrix.ubuntu-version }} packaging related Rust files | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:${{ matrix.ubuntu-version }} | |
env: | |
CARGO_VENDOR_DIR: ${{ github.workspace }}/vendor_rust | |
UPDATE_BRANCH: auto-update-rust-packaging-${{ matrix.ubuntu-version }} | |
steps: | |
- name: Install dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
CARGO_VENDOR_FILTERER_NOBLE_VERSION: 0.5.16 | |
shell: bash | |
run: | | |
set -euo pipefail | |
apt update -y | |
apt install -y dh-cargo git | |
if [ "${{ matrix.ubuntu-version }}" = "noble" ]; then | |
# Special behavior on noble as dh-cargo is not new enough there | |
apt install -y libssl-dev pkg-config | |
cargo install --locked --root=/usr \ | |
cargo-vendor-filterer@${{ env.CARGO_VENDOR_FILTERER_NOBLE_VERSION }} | |
else | |
apt install -y cargo-vendor-filterer | |
fi | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Vendor the dependencies | |
env: | |
CARGO_PATH: /usr/share/cargo/bin/cargo | |
shell: bash | |
run: | | |
set -euo pipefail | |
sh -x debian/vendor-rust.sh | |
- name: Update XS-Vendored-Sources-Rust | |
shell: bash | |
run: | | |
set -euo pipefail | |
VENDORED_SOURCES=$(/usr/share/cargo/bin/dh-cargo-vendored-sources 2>&1) \ | |
|| cmd_status=$? | |
OUTPUT=$(echo "$VENDORED_SOURCES" | grep ^XS-Vendored-Sources-Rust: || true) | |
if [ -z "${OUTPUT}" ]; then | |
if [ "${cmd_status:-0}" -ne 0 ]; then | |
# dh-cargo-vendored-sources failed because of other reason, so let's fail with it! | |
echo "dh-cargo-vendored-sources failed:" | |
echo "${VENDORED_SOURCES}" | |
exit "${cmd_status}" | |
fi | |
echo "XS-Vendored-Sources-Rust is up to date. No change is needed."; | |
exit 0 | |
fi | |
sed -i "s/^XS-Vendored-Sources-Rust:.*/$OUTPUT/" debian/control | |
echo "modified=true" >> "${GITHUB_ENV}" | |
echo "update_branch=${UPDATE_BRANCH}" >> "${GITHUB_ENV}" | |
- name: Create Pull Request | |
if: ${{ env.modified == 'true' }} | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: Auto update packaging related Rust files | |
title: | | |
[${{ matrix.ubuntu-version }}] Auto update packaging related Rust files | |
labels: control, automated pr | |
branch: ${{ env.update_branch }} | |
delete-branch: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push branch | |
if: ${{ env.modified == 'true' }} | |
shell: bash | |
run: | | |
set -eu | |
git config --system --add safe.directory "${PWD}" | |
git push origin ${{ env.update_branch }}:${{ matrix.branch }} |