Bump actions/setup-dotnet from 3.0.3 to 4.1.0 #288
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI 🧪 | |
on: | |
push: | |
branches: | |
- main | |
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-and-test-${{matrix.os}} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ windows-latest ] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- name: "Setup .NET SDK" | |
uses: actions/setup-dotnet@v4.1.0 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
- name: "Dotnet Nuke Restore" | |
run: ./build.ps1 Restore | |
shell: pwsh | |
- name: "Dotnet Nuke Build" | |
run: ./build.ps1 Compile -Configuration Release | |
shell: pwsh | |
- name: "Dotnet Nuke Test" | |
run: ./build.ps1 Test | |
shell: pwsh | |
- name: "Dotnet Nuke Pack" | |
run: ./build.ps1 Pack | |
shell: pwsh | |
- name: "Publish Artifacts" | |
uses: actions/upload-artifact@v4 | |
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/xshaheen/xdot-paymob/packages | |
permissions: | |
packages: write | |
runs-on: windows-latest | |
steps: | |
- name: "Download Artifacts" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "windows-latest" | |
- name: "Dotnet NuGet Add Source" | |
run: dotnet nuget add source https://nuget.pkg.github.com/xshaheen/index.json --name GitHub --username xshaheen --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/Xdot.Paymob.CashIn | |
runs-on: windows-latest | |
steps: | |
- name: "Download Artifacts" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "windows-latest" | |
- name: "Dotnet NuGet Push" | |
run: | | |
Get-ChildItem .\ -Filter *.nupkg | | |
Where-Object { !$_.Name.Contains('preview') } | | |
ForEach-Object { | |
Write-Host "Dotnet NuGet Push: $($_.Name)" | |
dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} | |
} | |
shell: pwsh | |