-
Notifications
You must be signed in to change notification settings - Fork 117
110 lines (90 loc) · 2.98 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
name: main-build
#this drops to nuget
on:
push:
branches: [ main]
paths-ignore:
- 'templates/**'
workflow_dispatch:
jobs:
build:
name: Build Comet-Nuget
env:
NUPKG_MAJOR: 0.2
BASE: 334
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-java@v2
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '11'
- name: install .NET
shell: pwsh
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -InstallDir "$env:ProgramFiles\dotnet\" -Verbose -Channel STS
& dotnet --list-sdks
# - name: Install Visual Studio Preview
# shell: pwsh
# run: powershell .\build\install-vs.ps1
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-prerelease: true
- name: Install Maui Workload
shell: pwsh
run: |
& dotnet workload install maui `
--skip-sign-check
- name: Restore Comet-Nuget.sln
run: msbuild /r build/Comet-Nuget.sln
- name: Build Comet-Nuget.sln
run: MSBuild build/Comet-Nuget.sln
- name: Nuget Pack step
shell: bash
run: |
MINOR_VERSION=$(( $BASE + $GITHUB_RUN_NUMBER ))
VERSION=0.3.$MINOR_VERSION-beta
echo "PACKAGE VERSION: $VERSION"
nuget pack Comet.nuspec -version $VERSION -Symbols -SymbolPackageFormat snupkg
# - name: Nuget Pack Template step
# shell: bash
# run: |
# MINOR_VERSION=$(( $BASE + $GITHUB_RUN_NUMBER ))
# VERSION=0.3.$MINOR_VERSION-beta
# echo "PACKAGE VERSION: $VERSION"
# nuget pack "templates\comet-templates.nuspec" -version $VERSION
- uses: actions/upload-artifact@v2
name: Upload Nuget Artifact
with:
name: nuget-artifact
path: |
**\*.nupkg
**\*.snupkg
**\*.symbols.nupkg
publish:
name: Publish
needs:
- build
runs-on: windows-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: nuget-artifact
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: 'latest'
- name: Push nuget to Nuget.org
run: |
nuget push nuget-artifact\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_ORG_API_KEY }} -SkipDuplicate