chore: update project, solution, pipeline files to latest libNOM format #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: libNOM.collect | |
on: | |
pull_request: | |
branches: [ master ] | |
push: | |
branches: [ master ] | |
create: | |
env: | |
dotnet: 8.0.x | |
jobs: | |
test: | |
name: Test | |
strategy: | |
matrix: | |
# November, 2024 / May, 2024 / November, 2026 | |
framwork: [net6.0, net7.0, net8.0] | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.dotnet }} | |
dotnet-quality: ga | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Unit Test | |
run: dotnet test libNOM.test --configuration Debug --framework ${{ matrix.framwork }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.dotnet }} | |
dotnet-quality: ga | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Pack | |
run: dotnet pack libNOM.collect --configuration Release | |
- name: Upload (NuGet) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet | |
path: ./libNOM.collect/bin/Release/libNOM.collect.*nupkg | |
if-no-files-found: error | |
- name: Upload (Release) | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Release | |
path: ./.github/changelogs/${{ github.ref_name }}.md | |
if-no-files-found: error | |
release: | |
name: Release | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged | |
runs-on: ubuntu-latest | |
needs: [test, build] | |
steps: | |
- name: Download | |
uses: actions/download-artifact@v4 | |
- name: Version | |
run: echo "nupkg_version=$((((Get-Item -Path ./NuGet/libNOM.collect.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV | |
shell: pwsh | |
- name: Mismatch | |
if: ${{ github.ref_name != env.nupkg_version }} | |
run: | | |
echo "There is a version mismatch between git tag (${{ github.ref_name }}) and nupkg version (${{ env.nupkg_version }})!" | |
exit 1 | |
- name: Create | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: ./Release/${{ github.ref_name }}.md | |
files: ./NuGet/libNOM.collect.*nupkg | |
- name: Publish | |
run: dotnet nuget push ./NuGet/libNOM.collect.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |