doc: update package description (#171) #42
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:" atribute to make sure they run sequentially. | |
jobs: | |
update-rust-packaging: | |
name: Update packaging related Rust files | |
runs-on: ubuntu-latest | |
# Right now, ubuntu 22.04 does not have the dh-cargo-vendored-sources script that is needed to | |
# run this job, so we need to run it inside a rolling container to get the latest version possible. | |
# This should be updated as soon as the dh-cargo version with the mentioned script gets ported to | |
# 22.04 or ubuntu-latest changes to a more recent version. | |
container: | |
image: ubuntu:rolling | |
steps: | |
- name: Install dependencies | |
run: | | |
DEBIAN_FRONTEND=noninteractive apt update | |
DEBIAN_FRONTEND=noninteractive apt install -y cargo dh-cargo git jq | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Vendor the dependencies | |
run: | | |
cargo vendor vendor_rust/ | |
- name: Update XS-Vendored-Sources-Rust | |
run: | | |
set -eu | |
export CARGO_VENDOR_DIR=vendor_rust/ | |
VENDORED_SOURCES=$(/usr/share/cargo/bin/dh-cargo-vendored-sources 2>&1 || true) | |
OUTPUT=$(echo "$VENDORED_SOURCES" | grep ^XS-Vendored-Sources-Rust: || true) | |
if [ -z "$OUTPUT" ]; then | |
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 | |
shell: bash | |
# Since we run this job in a container, we need to manually add the safe directory due to some | |
# issues between actions/checkout and actions/runner, which seem to be triggered by multiple | |
# causes (e.g. https://github.com/actions/runner-images/issues/6775, https://github.com/actions/checkout/issues/1048#issuecomment-1356485556). | |
- name: work around permission issue with git vulnerability (we are local here). TO REMOVE | |
run: git config --global --add safe.directory "$PWD" | |
- name: Create Pull Request | |
if: ${{ env.modified == 'true' }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: Auto update packaging related Rust files | |
title: Auto update packaging related Rust files | |
labels: control, automated pr | |
branch: auto-update-rust-packaging | |
delete-branch: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push branch | |
if: ${{ env.modified == 'true' }} | |
run: | | |
git push origin auto-update-rust-packaging:main |