forked from kalkih/mini-graph-card
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Auto-update README.md with versions
Only happens while releasing on master: * `NEXT_VERSION` should be used in all the `README.md` `since` columns. * Links and url will automatically be updated to the latest release
- Loading branch information
Showing
5 changed files
with
123 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
/* eslint-disable no-template-curly-in-string */ | ||
module.exports = { | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
["@semantic-release/npm", { | ||
"npmPublish": false, | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
'@semantic-release/changelog', | ||
['@semantic-release/npm', { | ||
npmPublish: false, | ||
}], | ||
["@semantic-release/github", { | ||
"assets": "dist/*.js" | ||
['@semantic-release/exec', { | ||
prepareCmd: './scripts/update_readme.sh "${nextRelease.version}" "$GITHUB_REF"', | ||
}], | ||
"@semantic-release/git" | ||
['@semantic-release/git', { | ||
assets: [ | ||
'CHANGELOG.md', | ||
'README.md', | ||
'package.json', | ||
'package-lock.json', | ||
'npm-shrinkwrap.json', | ||
], | ||
}], | ||
['@semantic-release/github', { | ||
assets: 'dist/*.js', | ||
}], | ||
], | ||
preset: 'angular', | ||
branches: [ | ||
{ name: 'master' }, | ||
{ name: 'dev', prerelease: true }, | ||
], | ||
"preset": "angular", | ||
"branches": [ | ||
"master", | ||
{ "name": "dev", "prerelease": true }, | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
VERSION=$1 | ||
BRANCH=$2 | ||
|
||
if [ -z "${VERSION}" ]; then | ||
echo "Version not specified; Exiting." | ||
exit 1; | ||
fi | ||
if [ -z "${BRANCH}" ]; then | ||
echo "Version not specified; Exiting." | ||
exit 1; | ||
fi | ||
|
||
if [ ! "${BRANCH}" = "refs/heads/master" ]; then | ||
echo "Branch is ${BRANCH}; README.md not updated." | ||
exit 0; | ||
fi | ||
|
||
sed -i -e "s/NEXT_VERSION/v${VERSION}/g" ./README.md | ||
sed -i -e "s|https://github.com/kalkih/mini-graph-card/releases/download/.*/mini-graph-card-bundle.js|https://github.com/kalkih/mini-graph-card/releases/download/v${VERSION}/mini-graph-card-bundle.js|g" ./README.md | ||
sed -i -e "s|-\surl:\s/local/mini-graph-card-bundle.js?v=.*|- url: /local/mini-graph-card-bundle.js?v=${VERSION}|g" ./README.md | ||
|