-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (118 loc) · 3.7 KB
/
main.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
concurrency:
group: ${{github.workflow}} - ${{github.ref}}
cancel-in-progress: true
env:
GitVersion_Version: '5.6.x'
jobs:
build-tools:
name: Build Tools
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- name: Build - CI
run: |
$adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower();
dotnet build src/NvGet.sln /p:PackageVersion=$adjustedPackageVersion /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} "/p:PackageOutputPath=$env:GITHUB_WORKSPACE\artifacts" /p:GeneratePackageOnBuild=true
- name: Run Unit Tests
run: |
cd src
dotnet test
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: NuGet
path: .\artifacts
build-extensions:
name: Build Extensions
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.300'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- name: Install tfx
working-directory: extensions/azuredevops
run: npm install tfx-cli@0.7.x -g --no-audit --no-fund
- name: npm install
working-directory: extensions/azuredevops
run: npm install
- name: Compile
working-directory: extensions/azuredevops
run: .\node_modules\.bin\tsc -project .\tsconfig.json --listEmittedFiles --locale en-US --isolatedModules
- name: Package Extension
working-directory: extensions/azuredevops
run: tfx extension create --json --no-color --output-path .\artifacts\Build.Tasks.${{ steps.gitversion.outputs.MajorMinorPatch }}.vsix --override "{\"version\":\"${{ steps.gitversion.outputs.MajorMinorPatch }}\"}"
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: extensions
path: .\artifacts
publish-tools:
name: Publish
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/master')) }}
runs-on: windows-latest
needs:
- build-tools
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: NuGet
path: artifacts
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: NuGet Push
run: |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }}