|
3 | 3 | GIT_STATUS=`git status | grep "nothing to commit, working tree clean" | wc -l` |
4 | 4 | if (( "$GIT_STATUS" > 0 )); then |
5 | 5 | git pull |
6 | | - cd eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn |
7 | 6 | CURRENT_NUMBER_OF_COMMITS=`git log --oneline | wc -l` |
8 | 7 |
|
| 8 | + cd eFormAPI/Plugins/OuterInnerResource.Pn/OuterInnerResource.Pn |
9 | 9 | PACKAGES=('Microting.eForm' 'Microting.eFormApi.BasePn' 'Microting.eFormOuterInnerResourceBase') |
10 | 10 | PROJECT_NAME='OuterInnerResource.Pn.csproj' |
11 | 11 | REPOSITORY='eform-angular-outer-inner-resource-plugin' |
12 | 12 |
|
| 13 | + for PACKAGE_NAME in ${PACKAGES[@]}; do |
| 14 | + |
| 15 | + OLD_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*' | grep -oP ' \d.* \b' | xargs` |
| 16 | + |
| 17 | + dotnet add $PROJECT_NAME package $PACKAGE_NAME |
| 18 | + |
| 19 | + NEW_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*$' | grep -oP '\d\.\d+\.\d.*$' | grep -oP ' \d\.\d+\.\d.*$' | xargs` |
| 20 | + |
| 21 | + if [ $NEW_VERSION != $OLD_VERSION ]; then |
| 22 | + echo "We have a new version of $PACKAGE_NAME, so creating github issue and do a commit message to close that said issue" |
| 23 | + RESULT=`curl -X "POST" "https://api.github.com/repos/microting/$REPOSITORY/issues?state=all" \ |
| 24 | + -H "Cookie: logged_in=no" \ |
| 25 | + -H "Authorization: token $CHANGELOG_GITHUB_TOKEN" \ |
| 26 | + -H "Content-Type: text/plain; charset=utf-8" \ |
| 27 | + -d $'{ |
| 28 | + "title": "Bump '$PACKAGE_NAME' from '$OLD_VERSION' to '$NEW_VERSION'", |
| 29 | + "body": "TBD", |
| 30 | + "assignees": [ |
| 31 | + "renemadsen" |
| 32 | + ], |
| 33 | + "labels": [ |
| 34 | + ".NET", |
| 35 | + "backend", |
| 36 | + "enhancement" |
| 37 | + ] |
| 38 | + }'` |
| 39 | + ISSUE_NUMBER=`echo $RESULT | grep -oP 'number": \d+,' | grep -oP '\d+'` |
| 40 | + git add . |
| 41 | + git commit -a -m "closes #$ISSUE_NUMBER" |
| 42 | + fi |
| 43 | + done |
| 44 | + |
| 45 | + cd .. |
| 46 | + cd OuterInnerResource.Pn.Test |
| 47 | + PACKAGES=('Microsoft.NET.Test.Sdk' 'NSubstitute' 'NUnit' 'NUnit3TestAdapter' 'NUnit.Analyzers' 'Testcontainers' 'Testcontainers.Mariadb') |
| 48 | + PROJECT_NAME='OuterInnerResource.Pn.Test.csproj' |
| 49 | + REPOSITORY='eform-angular-outer-inner-resource-plugin' |
| 50 | + |
13 | 51 | for PACKAGE_NAME in ${PACKAGES[@]}; do |
14 | 52 |
|
15 | 53 | OLD_VERSION=`dotnet list package | grep "$PACKAGE_NAME " | grep -oP ' \d\.\d+\.\d.*' | grep -oP ' \d.* \b' | xargs` |
|
0 commit comments