Skip to content

Update src/Microsoft.Graph.Cli.Core.Tests/Http/UriReplacement/MeUriRe… #654

Update src/Microsoft.Graph.Cli.Core.Tests/Http/UriReplacement/MeUriRe…

Update src/Microsoft.Graph.Cli.Core.Tests/Http/UriReplacement/MeUriRe… #654

Workflow file for this run

name: Release solution
on:
workflow_dispatch:
push:
# paths: ['src/**', '.github/workflows/**', 'msgraph-cli-core.sln']
jobs:
build:
runs-on: ubuntu-latest
env:
MS_NUGET_URL: https://nuget.pkg.github.com/microsoft/index.json
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core SDK 6
uses: actions/[email protected]
with:
dotnet-version: 7.x
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install dependencies
run: dotnet restore
- name: Test
run: dotnet test --no-restore
- id: publish
name: Publish
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: dotnet publish --no-restore --verbosity normal -c Release
- id: pack
name: Pack
if: ${{ steps.publish.outcome == 'success' }}
run: dotnet pack --no-restore --no-build --verbosity normal -c Release
- name: Upload Nuget Package
if: ${{ steps.pack.outcome == 'success' }}
uses: actions/upload-artifact@v3
with:
name: drop
path: |
./src/Microsoft.Graph.Cli.Core/bin/Release/*.nupkg
deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 7.x
- uses: actions/download-artifact@v3
with:
name: drop
- run: dotnet nuget push "*.nupkg" --skip-duplicate -s https://nuget.pkg.github.com/microsoftgraph/index.json -k ${{ secrets.GITHUB_TOKEN }}