Skip to content

Commit

Permalink
feat: update deprecation version number in semantic-release run
Browse files Browse the repository at this point in the history
* Automated using myii/ssf-formula#104
  • Loading branch information
myii committed Nov 26, 2019
1 parent 4348b59 commit 4b34d13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions pre-commit_semantic-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ sed -i -e '1,4s/-/=/g' CHANGELOG.rst

# Return back to the main directory
cd ..


###############################################################################
# (C) Update last version before `v1.0.0` with `${nextRelease.version}`
###############################################################################
# Only apply this while the version number is below `v1.0.0`!
V_REPR=v${1}
MAJOR=$(echo "${V_REPR}" | cut -c-2)
if [ "${MAJOR}" = "v0" ]; then
sed -i -e "s@^\(\s\+\`\).*\(\s<https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/\).*\(>\`_\.\)@\1${V_REPR}\2${V_REPR}\3@" docs/README.rst
sed -i -e "s@^\(\s\+# the final release tag before \`v1.0.0\`, which is expected to be \`\).*\(\`.\s\+#\)@\1${V_REPR}\2@" fail2ban/deprecated.sls
fi
2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
}],
['@semantic-release/git', {
assets: ['*.md', 'docs/*.rst', 'FORMULA'],
assets: ['*.md', 'docs/*.rst', 'FORMULA', 'fail2ban/deprecated.sls'],
}],
'@semantic-release/github',
],
Expand Down

0 comments on commit 4b34d13

Please sign in to comment.