Skip to content

Commit

Permalink
GHA: set version via "git describe"
Browse files Browse the repository at this point in the history
* for this to work, we need to set "fetch-depth",
  in order to check out all tags
  • Loading branch information
janusw committed Feb 27, 2024
1 parent 031470f commit 93c05d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
Expand All @@ -23,14 +25,16 @@ jobs:
- name: Install dependencies
run: dotnet restore src/GeoJSON.Net.sln
- name: Build
run: dotnet build src/GeoJSON.Net.sln --configuration Release --no-restore
run: dotnet build src/GeoJSON.Net.sln -c Release --no-restore -p:Version=$(git describe --tags)
- name: Test
run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal

winBuild:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
Expand All @@ -40,6 +44,6 @@ jobs:
- name: Install dependencies
run: dotnet restore src/GeoJSON.Net.sln
- name: Build
run: dotnet build src/GeoJSON.Net.sln --configuration Release --no-restore
run: dotnet build src/GeoJSON.Net.sln -c Release --no-restore -p:Version=$(git describe --tags)
- name: Test
run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal

0 comments on commit 93c05d3

Please sign in to comment.