forked from Schanbro/WeekFocus
chore: feat: add CHANGELOG
This commit is contained in:
1 parent
78d23f9cda
commit
57f1c727be
2 files changed
+35
-6
No files matched your search
@@ -103,11 +103,43 @@ jobs:
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||
|
||||
- name: Release-Notes aus CHANGELOG.md extrahieren
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
NOTES_FILE="$RUNNER_TEMP/release_notes.md"
|
||||
|
||||
if [ -f CHANGELOG.md ]; then
|
||||
awk -v ver="$VERSION" '
|
||||
/^##[[:space:]]/ {
|
||||
if (found) exit
|
||||
line = $0
|
||||
sub(/^##[[:space:]]+/, "", line)
|
||||
sub(/^\[?v?/, "", line)
|
||||
if (substr(line, 1, length(ver)) == ver) {
|
||||
rest = substr(line, length(ver) + 1)
|
||||
if (rest ~ /^([^0-9.]|$)/) { found = 1 }
|
||||
}
|
||||
next
|
||||
}
|
||||
found { print }
|
||||
' CHANGELOG.md > "$NOTES_FILE"
|
||||
else
|
||||
: > "$NOTES_FILE"
|
||||
fi
|
||||
|
||||
if ! grep -q '[^[:space:]]' "$NOTES_FILE"; then
|
||||
echo "Keine Release-Notes für Version $VERSION vorhanden." > "$NOTES_FILE"
|
||||
fi
|
||||
|
||||
echo "Release-Notes:"
|
||||
cat "$NOTES_FILE"
|
||||
|
||||
- name: Release in Gitea erstellen
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: ${{ github.ref_name }}
|
||||
body_path: ${{ runner.temp }}/release_notes.md
|
||||
files: app/build/outputs/apk/release/WeekFocus-*.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in new issue
Block a user