diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cb5fa51..363fb96 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,20 +29,28 @@ jobs: lastTagMainVersion=$(sed -n 's/^\([0-9]*\.[0-9]*\).*/\1/p' <<<"$lastTag") currentVersion=$(cat VERSION) currentMainVersion=$(sed -n 's/^\([0-9]*\.[0-9]*\).*/\1/p' > $GITHUB_ENV else - echo "New version!" - newVersion="$currentMainVersion".1 - VersionPrefix=$newVersion - echo "newVersion=$newVersion" - echo "newVersion=$newVersion" >> $GITHUB_ENV + if [ "$lastTagMainVersion" = "$currentMainVersion" ] + then + echo "Version the same." + lastTagBuildVersion=$(sed -n 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p' <<<"$lastTag") + newBuildVersion=$((lastTagBuildVersion+1)) + newVersion="$lastTagMainVersion"."$newBuildVersion" + echo "newVersion=$newVersion" + echo "newVersion=$newVersion" >> $GITHUB_ENV + else + echo "New version!" + newVersion="$currentMainVersion".1 + VersionPrefix=$newVersion + echo "newVersion=$newVersion" + echo "newVersion=$newVersion" >> $GITHUB_ENV + fi fi sed -i '' -e "s/\(\)\(.*\)\(<\/Version>\)/\1$newVersion\3/" src/UnityMVVM/UnityMVVM.csproj - name: Run tests