-
Notifications
You must be signed in to change notification settings - Fork 11
74 lines (69 loc) · 2.27 KB
/
release-dotnet.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
name: .NET (release)
on:
workflow_call:
workflow_dispatch:
inputs:
packageVersion:
description: 'Version to build'
required: true
default: ''
jobs:
package_nuget:
name: Package Nuget
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: trinsic-id/[email protected]
id: setversion
with:
githubToken: ${{ secrets.API_GITHUB_TOKEN }}
overrideVersion: ${{ github.event.inputs.packageVersion }}
- name: release-downloader
uses: robinraju/release-downloader@v1
with:
repository: trinsic-id/okapi
latest: true
token: ${{ secrets.API_GITHUB_TOKEN }}
fileName: "libs.zip"
- name: Create Nuget package
run: |
python ../../../devops/build_sdks.py --package-version=${{ steps.setversion.outputs.packageVersion }} --language=dotnet
dotnet workload install ios
dotnet workload install maccatalyst
dotnet restore
dotnet build -c Release
dotnet pack -p:SkipNativeLibsCopy=true -p:Configuration=Release -p:PackageVersion=${{ steps.setversion.outputs.packageVersion }}
shell: pwsh
working-directory: ./dotnet/Library/Okapi
- name: Upload nuget artifact
uses: actions/upload-artifact@v3
with:
name: nuget
path: |
./dotnet/Library/Okapi/bin/Release/*.nupkg
./dotnet/Library/Okapi/bin/Release/*.snupkg
publish_nuget:
name: Publish Nuget
needs: [package_nuget]
environment:
name: nuget.org
runs-on: windows-latest
steps:
- name: Download workflow artifact
uses: actions/download-artifact@v3
with:
name: nuget
- name: Push packages to Nuget
run: |
foreach ($item in get-childitem ./ -recurse | select-object FullName | where { $_.FullName.EndsWith(".nupkg") })
{
nuget push $item.FullName -ApiKey "${{ secrets.NUGET_API_KEY }}" -Source https://api.nuget.org/v3/index.json
}
shell: pwsh