Skip to content
# This workflow will build a .NET project and push packages to NuGet Gallery
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Generate OpinionatedFramework packages and push to NuGet Gallery
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: dotnet restore src
- name: Build
run: dotnet build src -c Release --no-restore
- name: Test
run: |
echo "Tests are temporarily disabled because the GCG test requires API calls to Google Cloud services."
# Uncomment the line below when tests are enabled
# dotnet test src -c Release --no-build --verbosity normal
- name: Pack
run: dotnet pack src --no-build -c Release --output ./nupkgs
- name: Push to NuGet
run: |
for file in ./nupkgs/*.nupkg; do
dotnet nuget push "$file" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
done