From 031470ffb2da4afa660d73bf7b0a19e745b6f5f5 Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Tue, 27 Feb 2024 22:04:28 +0100 Subject: [PATCH 1/3] GHA: add a Windows build --- .github/workflows/main.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index efbaf8c..e93ffaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,26 @@ on: workflow_dispatch: jobs: - build: + linuxBuild: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 3.1.x + 5.0.x + - name: Install dependencies + run: dotnet restore src/GeoJSON.Net.sln + - name: Build + run: dotnet build src/GeoJSON.Net.sln --configuration Release --no-restore + - name: Test + run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal + winBuild: + runs-on: windows-latest steps: - uses: actions/checkout@v2 - name: Setup .NET Core From 93c05d3e453062d83b0bd1c7e16deff7528b70ef Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Tue, 27 Feb 2024 22:19:12 +0100 Subject: [PATCH 2/3] GHA: set version via "git describe" * for this to work, we need to set "fetch-depth", in order to check out all tags --- .github/workflows/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e93ffaf..a6e2eb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -23,7 +25,7 @@ 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 @@ -31,6 +33,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: @@ -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 From 4405777994b4b49f01cf9e75b1044743e250ff1f Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Tue, 27 Feb 2024 22:40:55 +0100 Subject: [PATCH 3/3] GHA: upload nupkg as artifact --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6e2eb9..04ecf93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,5 +45,10 @@ jobs: run: dotnet restore src/GeoJSON.Net.sln - name: Build run: dotnet build src/GeoJSON.Net.sln -c Release --no-restore -p:Version=$(git describe --tags) + - name: Upload package + uses: actions/upload-artifact@v4 + with: + name: nupkg + path: ./src/GeoJSON.Net/bin/Release/*.nupkg - name: Test run: dotnet test src/GeoJSON.Net.sln --no-restore --verbosity normal