Skip to content

Add sample project with example output. #87

Add sample project with example output.

Add sample project with example output. #87

name: Test and Publish
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
on:
push:
pull_request:
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
include-prerelease: true
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build
push:
name: NuGet Push
runs-on: windows-latest
needs: [build]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
include-prerelease: true
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Generate NuGet packages
run: dotnet pack --configuration Release --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --output ./packages
- uses: actions/upload-artifact@v2
with:
name: Artifacts
path: ./packages/
- name: Publish packages
run: |
Get-ChildItem -Path ./packages/ -Filter *.nupkg -File -Name | ForEach-Object {
dotnet nuget push ./packages/$_ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
}
shell: pwsh
train:
name: Intellicode Train
runs-on: windows-latest
needs: [build]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # We need to fetch the entire Git history in order to verify the authenticity.
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
include-prerelease: true
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Train Intellicode Model
uses: microsoft/vs-intellicode@v1