Skip to content

Commit 93c05d3

Browse files
committed
GHA: set version via "git describe"
* for this to work, we need to set "fetch-depth", in order to check out all tags
1 parent 031470f commit 93c05d3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
1719
- name: Setup .NET Core
1820
uses: actions/setup-dotnet@v4
1921
with:
@@ -23,14 +25,16 @@ jobs:
2325
- name: Install dependencies
2426
run: dotnet restore src/GeoJSON.Net.sln
2527
- name: Build
26-
run: dotnet build src/GeoJSON.Net.sln --configuration Release --no-restore
28+
run: dotnet build src/GeoJSON.Net.sln -c Release --no-restore -p:Version=$(git describe --tags)
2729
- name: Test
2830
run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal
2931

3032
winBuild:
3133
runs-on: windows-latest
3234
steps:
3335
- uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
3438
- name: Setup .NET Core
3539
uses: actions/setup-dotnet@v4
3640
with:
@@ -40,6 +44,6 @@ jobs:
4044
- name: Install dependencies
4145
run: dotnet restore src/GeoJSON.Net.sln
4246
- name: Build
43-
run: dotnet build src/GeoJSON.Net.sln --configuration Release --no-restore
47+
run: dotnet build src/GeoJSON.Net.sln -c Release --no-restore -p:Version=$(git describe --tags)
4448
- name: Test
4549
run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal

0 commit comments

Comments
 (0)