Skip to content

Commit

Permalink
Test changelog on rpm (#315)
Browse files Browse the repository at this point in the history
Co-authored-by: wangluwei <wangluwei@uniontech.com>
  • Loading branch information
ssbarnea and daaitudian authored May 28, 2024
1 parent 8b339ae commit 022cb03
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ actions:
get-current-version:
- ./tools/get-version.sh
post-upstream-clone:
- ./tools/update-version.sh
- ./tools/update-spec.sh
srpm_build_deps:
- python3-build
- python3-setuptools_scm
Expand Down Expand Up @@ -39,3 +39,6 @@ jobs:
# trigger: release
# metadata:
# dist-git-branch: master
notifications:
pull_request:
successful_build: false
15 changes: 15 additions & 0 deletions tools/update-spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
DIR=$(dirname "$0")
VERSION=$(./tools/get-version.sh)
mkdir -p "${DIR}/../dist"
sed -e "s/VERSION_PLACEHOLDER/${VERSION}/" \
"${DIR}/../.config/python3-ansible-compat.spec" \
> "${DIR}/../dist/python3-ansible-compat.spec"

export LC_ALL=en_US.UTF-8
CHANGELOG=$(git log -n 20 --pretty="* %ad %an %ae \n- %s\n" --date=format:"%a %b %d %Y")
NUM=$(grep -nr "%changelog" ${DIR}/../dist/python3-ansible-compat.spec|awk -F':' '{print $1}')
let NUM_START=$NUM+1
NUM_END=$(awk '{print NR}' ${DIR}/../dist/pytho3n-ansible-compat.spec|tail -n1)
sed -i "${NUM_START},${NUM_END}d" ${DIR}/../dist/python3-ansible-compat.spec
echo -e "$CHANGELOG" >> ${DIR}/../dist/python3-ansible-compat.spec
7 changes: 0 additions & 7 deletions tools/update-version.sh

This file was deleted.

0 comments on commit 022cb03

Please sign in to comment.