Skip to content

Commit

Permalink
ci: Complete version name is read from TAG
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Aloisio committed May 22, 2019
1 parent d4aa8de commit 3419921
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ jobs:
steps:
- checkout
- run:
name: Set EXTENDNO
name: Set Version from TAG
shell: /bin/bash
command: |
if [ -z "${CIRCLE_TAG}" ]; then
echo "Nothing to do. Not a release."
else
EXT_TAG="$(echo -n $CIRCLE_TAG | sed -e "s/[0-9._]\\+\\-//g")"
sed -i "s/EXTENDNO=.*/EXTENDNO=${EXT_TAG}/g" release/src-rt/version.conf
MAJOR_VER=$(echo "${CIRCLE_TAG}" | sed -E 's/([^-]*)-.*/\1/')
MINOR_VER=$(echo "${CIRCLE_TAG}" | sed -E 's/[^-]*-(.*)/\1/')
sed -i "s/SERIALNO=.*/SERIALNO=${MAJOR_VER}/g" release/src-rt/version.conf
sed -i "s/EXTENDNO=.*/EXTENDNO=${MINOR_VER}/g" release/src-rt/version.conf
fi
- run:
name: Generate changelog (only for tags)
Expand All @@ -31,7 +33,7 @@ jobs:
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -vE "snapshot|beta|alpha" | grep ${REGXP_TO_MATCH} | head -n 2 | sed -n 2p)
echo "Generating logs between the tags ${PREVIOUS_TAG} and ${CURRENT_TAG}"
echo "Changes from the latest stable gnuton build (${PREVIOUS_TAG}):" > "${CHANGELOG_FILE}"
git log ${PREVIOUS_TAG}...${CURRENT_TAG} --pretty=format:'* %s' --reverse | grep -vE 'Merge branch|Bump' >> "${CHANGELOG_FILE}"
git log ${PREVIOUS_TAG}...${CURRENT_TAG} --pretty=format:'* %s' --reverse | grep -vE 'Merge branch|ci:|Bump' >> "${CHANGELOG_FILE}"
cat "${CHANGELOG_FILE}"
else
echo "No changelog to generate. Changelog is generated only for tags matching ${REGXP_TO_MATCH}";
Expand Down

0 comments on commit 3419921

Please sign in to comment.