Skip to content

Mapping for Singularity #207

Mapping for Singularity

Mapping for Singularity #207

Workflow file for this run

name: libNOM.map
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
create:
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-quality: ga
- name: Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Dependencies
run: dotnet restore
- name: Unit Test
run: |
dotnet test libNOM.test --no-restore --configuration Debug --framework netstandard2.0
dotnet test libNOM.test --no-restore --configuration Debug --framework netstandard2.1
dotnet test libNOM.test --no-restore --configuration Debug --framework net6.0
dotnet test libNOM.test --no-restore --configuration Debug --framework net7.0
- name: Pack
run: dotnet pack libNOM.map --no-restore --configuration Release
- name: Upload
uses: actions/upload-artifact@v3
with:
name: libNOM.map NuGet
path: libNOM.map/bin/Release/libNOM.map.*nupkg
if-no-files-found: error
release:
name: Release
runs-on: ubuntu-latest
# Only if commit was tagged.
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: build
steps:
# Checkout again to access the changelog.
- name: Checkout
uses: actions/checkout@v3
- name: Download
uses: actions/download-artifact@v3
with:
name: libNOM.map NuGet
- name: Version
run: echo "nupkg_version=$((((Get-Item -Path .\libNOM.map.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV
shell: pwsh
# Exit if version mismatch.
- 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@v1
with:
body_path: ${{ github.workspace }}/.github/changelogs/${{ github.ref_name }}.md
files: libNOM.map.*nupkg
- name: Publish
run: dotnet nuget push ./libNOM.map.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}