forked from dreamquark-ai/tabnet
-
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: adding prepare-release script
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 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
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,7 @@ | ||
FROM node:10.16.0-alpine@sha256:07897ec27318d8e43cfc6b1762e7a28ed01479ba4927aca0cdff53c1de9ea6fd | ||
|
||
RUN apk add git | ||
|
||
RUN npm i -g conventional-changelog-cli | ||
RUN npm i -g conventional-github-releaser | ||
|
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,43 @@ | ||
#!/bin/bash | ||
|
||
# stop if error | ||
set -e | ||
|
||
read -p 'Release version: ' version | ||
echo ${version} | grep v && echo "Version should be x.y.z (for example, 1.1.1, 2.0.0, ...)" && exit -1 | ||
|
||
localDir=`readlink -f .` | ||
releaseDir="${localDir}/release-${version}" | ||
rm -rf ${releaseDir} | ||
mkdir ${releaseDir} | ||
cd $releaseDir | ||
|
||
echo "Cloning repo into tabnet" | ||
git clone -q [email protected]:dreamquark-ai/tabnet.git tabnet | ||
|
||
cd tabnet | ||
# Create release branch and push it | ||
git checkout -b release/${version} | ||
|
||
# Change version of package | ||
docker run --rm -v ${PWD}:/work -w /work python-poetry:latest poetry version ${version} | ||
# Add modified file | ||
git add pyproject.toml | ||
# Commit release | ||
git commit -m "chore: release v${version}" | ||
# Create tag for changelog generation | ||
git tag v${version} | ||
docker run -v ${PWD}:/work -w /work --entrypoint "" release-changelog:latest conventional-changelog -p angular -i CHANGELOG.md -s -r 0 | ||
docker run -v ${PWD}:/work -w /work --entrypoint "" release-changelog:latest chmod 777 CHANGELOG.md | ||
# Removing 4 first line of the file | ||
echo "$(tail -n +4 CHANGELOG.md)" > CHANGELOG.md | ||
# Deleting tag | ||
git tag -d v${version} | ||
# Adding CHANGELOG to commit | ||
git add CHANGELOG.md | ||
git commit --amend --no-edit | ||
# Push release branch | ||
git push origin release/${version} | ||
|
||
cd ${localDir} | ||
rm -rf ${releaseDir} |