Skip to content

chore(deps): update actions/setup-dotnet action to v3.3.0 #518

chore(deps): update actions/setup-dotnet action to v3.3.0

chore(deps): update actions/setup-dotnet action to v3.3.0 #518

Workflow file for this run

name: Build
on:
push:
branches:
- main
- renovate/*
pull_request:
release:
types:
- published
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
MINVERBUILDMETADATA: build.${{github.run_number}}
jobs:
build:
name: Build-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
steps:
- name: "Checkout"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
lfs: true
fetch-depth: 0
- name: "Install .NET Core SDK"
uses: actions/setup-dotnet@ea9897a6e57642ca932850b656df2880bc7cd2a8 # v3.3.0
- name: "Dotnet Tool Restore"
run: dotnet tool restore
- name: "Dotnet Cake Build"
run: dotnet cake --target=Build
- name: "Dotnet Cake Test"
run: dotnet cake --target=Test
- name: "Dotnet Cake Pack"
run: dotnet cake --target=Pack
- name: "Publish artifacts"
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3.2.1
with:
name: ${{matrix.os}}
path: "./artifacts"
push-github-packages:
name: "Push GitHub Packages"
needs: build
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
environment:
name: "GitHub Packages"
url: https://github.com/JamieMagee/MicrosoftSecurityUpdates/packages
permissions:
packages: write
runs-on: windows-latest
steps:
- name: "Download Artifact"
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: "windows-latest"
- name: "Dotnet NuGet Add Source"
run: dotnet nuget add source https://nuget.pkg.github.com/JamieMagee/index.json --name GitHub --username JamieMagee --password ${{secrets.GITHUB_TOKEN}}
shell: pwsh
- name: "Dotnet NuGet Push"
run: dotnet nuget push .\*.nupkg --api-key ${{ github.token }} --source GitHub --skip-duplicate
shell: pwsh
push-nuget:
name: "Push NuGet Packages"
needs: build
if: github.event_name == 'release'
environment:
name: "NuGet"
url: https://www.nuget.org/packages/JamieMagee.MicrosoftSecurityUpdates.Client
runs-on: windows-latest
steps:
- name: "Download Artifact"
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: "windows-latest"
- name: "Dotnet NuGet Push"
run: |
Get-ChildItem .\ -Filter *.nupkg |
Where-Object { !$_.Name.Contains('preview') } |
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
shell: pwsh