mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-25 05:52:50 -05:00
distros: Enhance build automation
This commit is contained in:
31
.github/workflows/run-obs.yml
vendored
31
.github/workflows/run-obs.yml
vendored
@@ -113,6 +113,8 @@ jobs:
|
||||
name: Upload to OBS
|
||||
needs: check-updates
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
if: |
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
needs.check-updates.outputs.has_updates == 'true'
|
||||
@@ -293,6 +295,35 @@ jobs:
|
||||
bash distro/scripts/obs-upload.sh "$PACKAGES" "$MESSAGE"
|
||||
fi
|
||||
|
||||
- name: Commit changelog and spec updates
|
||||
run: |
|
||||
# Configure git user for commits
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
# Check if there are any changes to commit
|
||||
if git diff --exit-code distro/debian/ distro/opensuse/ >/dev/null 2>&1; then
|
||||
echo "📋 No changelog or spec changes to commit"
|
||||
else
|
||||
# Get list of changed packages for commit message
|
||||
CHANGED_DEB=$(git diff --name-only distro/debian/ 2>/dev/null | grep 'debian/changelog' | xargs dirname 2>/dev/null | xargs dirname 2>/dev/null | xargs basename 2>/dev/null | tr '\n' ', ' | sed 's/, $//' || echo "")
|
||||
CHANGED_SUSE=$(git diff --name-only distro/opensuse/ 2>/dev/null | grep '\.spec$' | sed 's|distro/opensuse/||' | sed 's/\.spec$//' | tr '\n' ', ' | sed 's/, $//' || echo "")
|
||||
|
||||
CHANGED=""
|
||||
[ -n "$CHANGED_DEB" ] && CHANGED="Debian: $CHANGED_DEB"
|
||||
[ -n "$CHANGED_SUSE" ] && [ -n "$CHANGED" ] && CHANGED="$CHANGED | "
|
||||
[ -n "$CHANGED_SUSE" ] && CHANGED="${CHANGED}OpenSUSE: $CHANGED_SUSE"
|
||||
|
||||
PKGS=$(echo "$CHANGED_DEB,$CHANGED_SUSE" | tr ',' '\n' | grep -v '^$' | sort -u | tr '\n' ',' | sed 's/,$//')
|
||||
|
||||
echo "📋 Committing changelog and spec updates for: $PKGS"
|
||||
|
||||
git add distro/debian/ distro/opensuse/
|
||||
git commit -m "ci: Auto-update OBS packages [$PKGS]" -m "🤖 Automated by GitHub Actions"
|
||||
|
||||
git push
|
||||
fi
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "### OBS Package Update Complete" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Reference in New Issue
Block a user