Skip to content

Forgot to remove dependency #3

Forgot to remove dependency

Forgot to remove dependency #3

Workflow file for this run

name: Build TerraformRegistryClient Project
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: windows-latest
outputs:
should-run: ${{ steps.set-output.outputs.should-run }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: dotnet restore ${{ github.workspace }}/TerraformRegistryClient/TerraformRegistryClient.sln
- name: Clean
run: dotnet clean ${{ github.workspace }}/TerraformRegistryClient/TerraformRegistryClient.sln --configuration Release
- name: Build
run: dotnet build ${{ github.workspace }}/TerraformRegistryClient/TerraformRegistryClient.sln --configuration Release --no-restore
- name: Test
run: dotnet test ${{ github.workspace }}/TerraformRegistryClient/TerraformRegistryClient.sln --configuration Release --no-build
- name: Set Output
run: echo "::set-output name=should-run::true"
id: set-output
pack_and_publish:
needs: [build_and_test]
if: needs.build_and_test.outputs.should-run == 'true'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Package
run: dotnet pack ${{ github.workspace }}/TerraformRegistryClient/TerraformRegistryClient.sln --configuration Release --no-build --output nupkgs
- name: Publish NuGet Package
run: |
nuget push **/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json
if: github.ref == 'refs/heads/main' && github.event_name == 'push'