Skip to content

Bump MaxMind.GeoIP2.UnitTests/TestData/MaxMind-DB from f387805 to 7ef0ff7 #331

Bump MaxMind.GeoIP2.UnitTests/TestData/MaxMind-DB from f387805 to 7ef0ff7

Bump MaxMind.GeoIP2.UnitTests/TestData/MaxMind-DB from f387805 to 7ef0ff7 #331

Workflow file for this run

name: Build and publish to NuGet
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
permissions: {}
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: true
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
run: dotnet build -c Release
- name: Run tests
run: dotnet test -c Release
env:
MAXMIND_TEST_BASE_DIR:
${{ github.workspace }}/MaxMind.GeoIP2.UnitTests
- name: Pack
run: dotnet pack -c Release MaxMind.GeoIP2/MaxMind.GeoIP2.csproj
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: nuget-packages
path: MaxMind.GeoIP2/bin/Release/*.nupkg
publish:
needs: build
runs-on: windows-latest
environment: nuget
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: nuget-packages
path: packages
- name: NuGet login
id: login
uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1
with:
user: ${{ secrets.NUGET_USER }}
- name: Push to NuGet
run: |
foreach ($file in Get-ChildItem packages/*.nupkg) {
dotnet nuget push $file.FullName --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json
}
env:
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}