Update release.yml #52
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/CD Workflow | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
jobs: | |
build-test-publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Full history required by Nerdbank.GitVersioning | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Restore Dependencies | |
run: dotnet restore | |
- name: Build Application | |
run: dotnet build --configuration Release --no-restore | |
- name: Run Tests | |
run: dotnet test --configuration Release --no-build --verbosity normal | |
- name: Pack Nuget Package | |
run: dotnet pack --configuration Release --output ${{ github.workspace }}\dx-cli\nupkgs | |
- name: Add GitHub Packages as a NuGet source | |
run: dotnet nuget add source https://nuget.pkg.github.com/devexlead/index.json --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} | |
- name: List files in dx-cli\nupkgs | |
run: dir ${{ github.workspace }}\dx-cli\nupkgs | |
- name: Publish to GitHub Packages | |
run: dotnet nuget push ${{ github.workspace }}\dx-cli\nupkgs\*.nupkg --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |