Skip to content

build(deps): bump actions/setup-dotnet from 4 to 5 #62

build(deps): bump actions/setup-dotnet from 4 to 5

build(deps): bump actions/setup-dotnet from 4 to 5 #62

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
check-format:
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET SDK v6.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
- name: Check format
run: dotnet format --verify-no-changes
HiddenWindow:
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup .NET SDK v6.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build --configuration=Release
package:
runs-on: windows-latest
needs: HiddenWindow
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup .NET SDK v6.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 6.0.x
- name: Build and package
run: dotnet build --configuration=Release
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@master
with:
setAllVars: true
- run: echo "Package generated artefacts/HiddenWindow.${{ env.NBGV_NuGetPackageVersion }}.nupkg"
- name: Upload NuGet package artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: artefacts/*.nupkg
# Publish NuGet packages when a tag is pushed.
# Build needs to succeed first, including having a tag name that matches the version number.
publish-release:
if: ${{ !github.event.repository.fork && startsWith(github.ref, 'refs/tags/v') }}
needs: package
runs-on: windows-latest
steps:
- name: Download NuGet package artifacts
uses: actions/download-artifact@v5
with:
name: nuget-packages
path: artefacts
- name: Publish to NuGet
run: |
if ("${{ github.ref }}" -like "refs/tags/v*") {
$tag = "${{ github.ref }}".SubString(11)
$expectedHiddenWindowFile = "artefacts/HiddenWindow.$tag.nupkg"
# Check whether the tag and the package version match together
if (-not (Test-Path -Path $expectedHiddenWindowFile)) {
echo "::error ::Expected file $expectedHiddenWindowFile doesn't exist"
exit 1
}
dotnet nuget push $expectedHiddenWindowFile --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
}