workflows cleanup (#287)

* remove install from assets

* Ignore debian/changelog in prepare pr

* fix changes.md written to main

---------

Co-authored-by: Meliox <na>
This commit is contained in:
Meliox 2026-08-09 14:20:19 +02:00 committed by GitHub
parent 877e57d2c9
commit 6c82bcfe7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 16 deletions

View File

@ -13,6 +13,7 @@ on:
paths: paths:
- 'src/**' - 'src/**'
- 'debian/**' - 'debian/**'
- '!debian/changelog'
pull_request: pull_request:
types: types:
- labeled - labeled
@ -45,24 +46,21 @@ jobs:
git fetch origin main git fetch origin main
# Collect all commits touching src/ since the last release tag (both paths need this)
LAST_TAG=$(git describe --tags --abbrev=0 origin/main 2>/dev/null || true)
if [[ -n "$LAST_TAG" ]]; then
LOG=$(git log "${LAST_TAG}..origin/main" --oneline -- src/ | head -50)
else
LOG=$(git log origin/main --oneline -- src/ | head -50)
fi
echo "${LOG:-No src/ changes since last release.}" > /tmp/CHANGES.md
if [[ "${{ github.event_name }}" == "push" ]]; then if [[ "${{ github.event_name }}" == "push" ]]; then
# Always recreate from main — avoids rebase conflicts after PR merge # Always recreate from main — avoids rebase conflicts after PR merge
git checkout -b chore/version-bump origin/main git checkout -b chore/version-bump origin/main
# Collect all commits touching src/ since the last release tag
LAST_TAG=$(git describe --tags --abbrev=0 origin/main 2>/dev/null || true)
if [[ -n "$LAST_TAG" ]]; then
LOG=$(git log "${LAST_TAG}..origin/main" --oneline -- src/ | head -50)
else
LOG=$(git log origin/main --oneline -- src/ | head -50)
fi
mkdir -p .github/version-bump
echo "${LOG:-No src/ changes since last release.}" > .github/version-bump/CHANGES.md
git add .github/version-bump/CHANGES.md
git diff --cached --quiet || git commit -m "chore: collect changes since ${LAST_TAG:-initial}"
git push --force origin chore/version-bump git push --force origin chore/version-bump
else else
# Label change: check out the existing branch, no CHANGES.md update # Label change: check out the existing branch
git fetch origin chore/version-bump git fetch origin chore/version-bump
git checkout chore/version-bump git checkout chore/version-bump
fi fi
@ -118,7 +116,7 @@ jobs:
env: env:
NEW_VERSION: ${{ steps.version.outputs.new }} NEW_VERSION: ${{ steps.version.outputs.new }}
run: | run: |
LOG=$(cat .github/version-bump/CHANGES.md 2>/dev/null || true) LOG=$(cat /tmp/CHANGES.md 2>/dev/null || true)
DATE=$(date -R) DATE=$(date -R)
# Base on main's changelog so reruns always replace the previous bot entry cleanly # Base on main's changelog so reruns always replace the previous bot entry cleanly
MAIN_CHANGELOG=$(git show origin/main:debian/changelog) MAIN_CHANGELOG=$(git show origin/main:debian/changelog)
@ -145,7 +143,7 @@ jobs:
{ {
echo "## Release v${NEW_VERSION}" echo "## Release v${NEW_VERSION}"
echo "" echo ""
cat .github/version-bump/CHANGES.md 2>/dev/null || echo "No changes recorded." cat /tmp/CHANGES.md 2>/dev/null || echo "No changes recorded."
echo "" echo ""
echo "---" echo "---"
echo "*Change label to \`bump:minor\` or \`bump:major\` before merging if needed.*" echo "*Change label to \`bump:minor\` or \`bump:major\` before merging if needed.*"

View File

@ -109,7 +109,6 @@ jobs:
DEB_ASC: ${{ steps.assets.outputs.deb_asc }} DEB_ASC: ${{ steps.assets.outputs.deb_asc }}
run: | run: |
ASSETS="$DEB $DEB_ASC /tmp/SHA256SUMS /tmp/SHA256SUMS.asc" ASSETS="$DEB $DEB_ASC /tmp/SHA256SUMS /tmp/SHA256SUMS.asc"
[[ -f install.sh ]] && ASSETS="$ASSETS install.sh"
gh release create "$TAG" \ gh release create "$TAG" \
--title "pve-mod $TAG" \ --title "pve-mod $TAG" \