Add InterfaceInclude opt-in #74
This file contains hidden or 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: .NET | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| tags: [ "v*" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Determine package version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [ "$GITHUB_REF_TYPE" = "tag" ]; then | |
| echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "version=0.1.0-ci.${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release /p:Version=${{ steps.version.outputs.version }} | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal --configuration Release | |
| - name: Pack | |
| run: dotnet pack MakeInterface.Generator/MakeInterface.Generator.csproj --no-build --configuration Release /p:PackageVersion=${{ steps.version.outputs.version }} -o ./artifacts | |
| - name: Publish prerelease to GitHub Packages | |
| if: github.event_name == 'push' && github.ref_type == 'branch' | |
| run: dotnet nuget push ./artifacts/MakeInterface.Generator.${{ steps.version.outputs.version }}.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
| - name: Publish release to NuGet.org | |
| if: github.ref_type == 'tag' | |
| run: dotnet nuget push ./artifacts/MakeInterface.Generator.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate |