Skip to content

chore(deps): update dependency dotnet-sdk to v7.0.305 (#96) #325

chore(deps): update dependency dotnet-sdk to v7.0.305 (#96)

chore(deps): update dependency dotnet-sdk to v7.0.305 (#96) #325

Workflow file for this run

name: Build
on:
push:
pull_request:
release:
types:
- published
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Set the build number in MinVer.
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
lfs: true
fetch-depth: 0
- name: "Install .NET Core SDK"
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
- name: "Dotnet Tool Restore"
run: dotnet tool restore
shell: pwsh
- name: "Dotnet Cake Build"
run: dotnet cake --target=Build
shell: pwsh
- name: "Dotnet Cake Test"
run: dotnet cake --target=Test
shell: pwsh
- name: "Dotnet Cake Pack"
run: dotnet cake --target=Pack
shell: pwsh
- name: "Publish Artifacts"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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/DockerReference/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.DockerReference
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