Set version dynamically based on GitHub run number

This commit adds a step to set the build version dynamically in the .github/workflows/dotnet.yml file. The new step uses the GitHub run number to update the version in the specified project file. This ensures that each build has a unique version based on the run number.
This commit is contained in:
Diego Colombo
2024-06-26 01:25:28 +01:00
parent a68539f903
commit b3e05acd3b
+5 -1
View File
@@ -24,7 +24,11 @@ jobs:
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Set version
run: |
echo "Buid version is ${{github.run_number}}"
sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.run_number}}/" ${{env.PROJECT_FILE}}
- name: Restore dependencies
run: dotnet restore
- name: Build