-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.42 KB
/
release-package.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
name: Release Microsoft.Graph.Batching
on:
workflow_dispatch:
# push:
# branches:
# - main
# paths:
# - .github/workflows/release-package.yml
# - src/Microsoft.Graph.Batching/**/*.cs
# - src/Microsoft.Graph.Batching/*.csproj
jobs:
build-and-push:
name: Build and release
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'Microsoft.Graph.Batching.sln'
PROJECT: 'src/Microsoft.Graph.Batching/Microsoft.Graph.Batching.csproj'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: /updateprojectfiles
- name: Restore dependencies
run: dotnet restore $SOLUTION
- name: Build solution
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore
- name: Create nuget package
run: dotnet pack $PROJECT -c $BUILD_CONFIG --no-build --no-restore --output .
- name: Push to NuGet
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate