Skip to content

Align workflow (#18) #53

Align workflow (#18)

Align workflow (#18) #53

Workflow file for this run

# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: 🏭 Build nuget
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
DOTNET_VERSION: "10.x"
NUGET_PACKAGE_NAME: "ClosureOSS.WebPush"
permissions:
contents: write
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.5.0
- name: Determine Version
id: meta
uses: gittools/actions/gitversion/execute@v4.5.0
- name: Restore dependencies
run: dotnet restore --locked-mode
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test --no-build -c Release --verbosity normal
- name: Upload Nuget package as Artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.NUGET_PACKAGE_NAME }}.${{ steps.meta.outputs.SemVer }}
path: ./artifacts/package/release/*nupkg
retention-days: 1