-
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (49 loc) · 2.2 KB
/
ci.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
name: CI
on:
push:
branches: [ master, release/* ]
tags: [ v* ]
pull_request:
branches: [ master, release/* ]
jobs:
build:
name: Build Job
runs-on: macos-13
defaults:
run:
working-directory: Source
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required for Calculate Version step (e.g. GitVersion)
# Required by GitVersion
- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0
- name: Install Workloads
run: dotnet workload restore
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.12.0'
- name: Generate Version Info using GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
additionalArguments: '/updateprojectfiles'
- name: NuGet
run: dotnet restore
# Smoke test to make sure the Example Client builds. We don't do a release build
# of the Example Client because it takes a long time and we don't publish it.
- name: Debug Build of Solution to Smoke test Example Client
run: dotnet build -c Debug
- name: Create NuGet Package
run: dotnet pack SaturdayMP.XPlugins.iOS.BEMCheckBox/SaturdayMP.XPlugins.iOS.BEMCheckBox.csproj -c Release
- name: Publish to MyGet
run: dotnet nuget push SaturdayMP.XPlugins.iOS.BEMCheckBox/bin/Release/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg -k ${{ secrets.MYGET_API_KEY }} -s https://www.myget.org/F/saturdaymp/api/v3/index.json
# Only push tagged builds to NuGet. These will be production or release candidates.
- name: Upload to NuGet
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push SaturdayMP.XPlugins.iOS.BEMCheckBox/bin/Release/SaturdayMP.XPlugins.iOS.BEMCheckBox.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols -s https://api.nuget.org/v3/index.json