forked from Mapsui/Mapsui
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (73 loc) · 2.91 KB
/
Copy pathdotnet-release-nugets.yml
File metadata and controls
92 lines (73 loc) · 2.91 KB
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
name: Release Nugets
on:
workflow_dispatch:
inputs:
release_nugets:
description: 'release to nuget.org'
required: true
type: boolean
jobs:
build:
env:
SOLUTION: 'Mapsui.NoMSBuild.slnf'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Prevent a shallow clone to allow git describe --tags
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.1.1
with:
nuget-version: latest
# .Net update
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
include-prerelease: false
# Android SDK Install
- name: Set up Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: '8512546'
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.1
with:
vs-prerelease: true
# The version tag needs to be set before the release. If not if will fail on nuget publish.
- name: Set VERSION_OF_RELEASE to last tag
run: |
echo ("VERSION_OF_RELEASE=" + $(git describe --tags --abbrev=0)) >> $env:GITHUB_ENV
echo $VERSION_OF_RELEASE
- name: install workloads
run: dotnet workload install maui macos android ios maccatalyst wasm-tools wasm-tools-net6 wasm-tools-net7
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
- name: Build
run: dotnet build ${{ env.SOLUTION }} --configuration Release --verbosity normal -p:Version=${{ env.VERSION_OF_RELEASE }}
- name: Test
run: dotnet test ${{ env.SOLUTION }} --configuration Release --verbosity normal -p:Version=${{ env.VERSION_OF_RELEASE }}
- name: Pack Uno UWP
run: |
msbuild Mapsui.UI.Uno/Mapsui.UI.Uno.csproj /t:restore /p:Configuration=Release
msbuild Mapsui.UI.Uno/Mapsui.UI.Uno.csproj /t:pack /p:Configuration=Release /p:Version=${{ env.VERSION_OF_RELEASE }} /p:PackageOutputPath="${{ github.workspace }}/nugets"
- name: Pack Xamarin Forms
run: |
msbuild Mapsui.UI.Forms/Mapsui.UI.Forms.csproj /t:restore /p:Configuration=Release
msbuild Mapsui.UI.Forms/Mapsui.UI.Forms.csproj /t:pack /p:Configuration=Release /p:Version=${{ env.VERSION_OF_RELEASE }} /p:PackageOutputPath="${{ github.workspace }}/nugets"
- name: Pack
run: dotnet pack ${{ env.SOLUTION }} --configuration Release /p:Version=${{ env.VERSION_OF_RELEASE }} -o nugets
- name: Upload nugets
uses: actions/upload-artifact@v3
with:
# Upload the 'nugets' folder as artifact
name: packages
path: nugets/*.nupkg
- name: Release NuGets
if: ${{ inputs.release_nugets }}
run: nuget push "nugets\**\*.nupkg" -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_APIKEY}}