-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (83 loc) · 2.42 KB
/
test-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- 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@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- 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 --output ./packages
- uses: actions/upload-artifact@v4
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
# TODO: Fix when I can be bothered to.
# train:
# name: Intellicode Train
# runs-on: windows-latest
# needs: [build]
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# steps:
# - uses: actions/checkout@v4
# 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@v4
# with:
# dotnet-version: |
# 6.0.x
# 7.0.x
# 8.0.x
# - name: Install dependencies
# run: dotnet restore
# - name: Build
# run: dotnet build --configuration Release --no-restore
# - name: Train Intellicode Model
# uses: microsoft/vs-intellicode@v1