All checks were successful
Synchronize Project Metadata / sync-prj-meta (push) Successful in 6s
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
43 lines
1.4 KiB
YAML
43 lines
1.4 KiB
YAML
name: Synchronize Project Metadata
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- "devel"
|
|
paths:
|
|
- "*" # Will trigger on new directories and changes to files in root of repository
|
|
- ".gitea/workflows/sync_meta.yaml"
|
|
- ".obs/common.py"
|
|
|
|
jobs:
|
|
sync-prj-meta:
|
|
runs-on: tumbleweed
|
|
steps:
|
|
- run: |
|
|
zypper in -y python3-jinja2
|
|
mkdir -p ~/.config/osc
|
|
cat >~/.config/osc/oscrc <<'EOF'
|
|
[general]
|
|
apiurl = https://api.opensuse.org
|
|
|
|
[https://api.opensuse.org]
|
|
user=${{ vars.OBS_USERNAME }}
|
|
pass=${{ secrets.OBS_PASSWORD }}
|
|
EOF
|
|
# Waiting on PR to get merged for support in upstream action/checkout action
|
|
- uses: 'https://github.com/yangskyboxlabs/action-checkout@sha256'
|
|
with:
|
|
object-format: 'sha256'
|
|
- run: |
|
|
PROJECT="$(grep PROJECT .obs/common.py | sed 's/PROJECT = "\(.*\)"/\1/')"
|
|
set -o pipefail
|
|
if meta="$(osc meta prj "${PROJECT}" 2>/dev/null | sha256sum)"; then
|
|
new_meta="$(python3 .obs/render_meta.py)"
|
|
if [ "${meta}" != "$(echo "${new_meta}" | sha256sum)" ]; then
|
|
echo "${new_meta}" | osc meta prj "${PROJECT}" -F -
|
|
fi
|
|
python3 .obs/sync_packages.py
|
|
else
|
|
# Create the projects
|
|
bash .obs/create_projects.sh
|
|
fi
|