name: .NET on: push: branches: [ master ] pull_request: branches: [ master ] env: # Stop wasting time caching packages DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable sending usage data to Microsoft DOTNET_CLI_TELEMETRY_OPTOUT: true # GitHub Packages Feed settings GITHUB_FEED: https://nuget.pkg.github.com/koenbeuk/ GITHUB_USER: koenbeuk GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] dotnet-version: [6.0.x] projectables-version: [1, 2] steps: - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ matrix.dotnet-version }} include-prerelease: True - name: Restore dependencies run: dotnet restore /p:EFProjectablesVersion=${{ matrix.projectables-version }} - name: Build run: dotnet build --no-restore /p:EFProjectablesVersion=${{ matrix.projectables-version }} - name: Test run: dotnet test --no-build --verbosity normal /p:EFProjectablesVersion=${{ matrix.projectables-version }} prerelease: needs: build if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.x include-prerelease: True - name: Pack v1 run: | dotnet pack -v normal -c DebugV1 --include-symbols --include-source -p:PackageVersion=1.0.0-pre-$GITHUB_RUN_ID -o nupkg - name: Pack v2 run: | dotnet pack -v normal -c Debug --include-symbols --include-source -p:PackageVersion=2.0.0-pre-$GITHUB_RUN_ID -o nupkg - name: Push to GitHub Feed run: | for f in ./nupkg/*.nupkg do dotnet nuget push $f --source $GITHUB_FEED --api-key ${{github.token}} --skip-duplicate --no-symbols true done