I want to have a gitlab CI in which a file named "version" will be read out (content will be like 1.1.0) and release my nuget with this version and then increase the minor number for the next time (e.g. 1.2.0 then).
this is my file now:
nuget_prod:
stage: nuget_prod
script:
- 'export VERSION=1.1.0' #READ FROM VERSION FILE
- 'TODO' # ADD VERSION NUMBER AND SAVE BACK TO VERSION FILE
- 'dotnet pack .\\myproj.csproj -p:PackageVersion=$VERSION'
- 'dotnet nuget push **/*.nupkg --api-key xxxx--source xxxx'
when: manual
only:
- master
You have some approaches here
It is not a hard task, there is a lot of ways to do it....just test which fits better in your environment