-
Notifications
You must be signed in to change notification settings - Fork 7
37 lines (30 loc) · 1.16 KB
/
nuget_push.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
name: NuGet Push
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
name: Update NuGet package
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v4
- name: Setup JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Extract Version from csproj
id: get_version
run: |
$version = Select-String -Path "./src/Aptabase.Maui.csproj" -Pattern '<Version>(.*)</Version>' | ForEach-Object { $_.Matches.Groups[1].Value }
echo "PackageVersion=$version" | Out-File -Append -FilePath $env:GITHUB_ENV
shell: powershell
- name: Build and Publish
run: |
cd ./src/
dotnet restore Aptabase.Maui.csproj
dotnet pack Aptabase.Maui.csproj -c Release -o artifacts -p:PackageVersion=${{ env.PackageVersion }}
- name: Push
run: dotnet nuget push ./src/artifacts/Aptabase.Maui.${{ env.PackageVersion }}.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json