Skip to content

Commit 0105ae3

Browse files
committed
Add Github Action for nuget pack & publish
1 parent d620784 commit 0105ae3

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/nuget_push.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: NuGet Push
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
name: Update NuGet package
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Setup .NET Core @ Latest
15+
uses: actions/setup-dotnet@v4
16+
17+
- name: Setup JDK 11
18+
uses: actions/setup-java@v2
19+
with:
20+
java-version: '11'
21+
distribution: 'adopt'
22+
23+
- name: Extract Version from csproj
24+
id: get_version
25+
run: |
26+
$version = Select-String -Path "./src/Aptabase.Maui.csproj" -Pattern '<Version>(.*)</Version>' | ForEach-Object { $_.Matches.Groups[1].Value }
27+
echo "PackageVersion=$version" | Out-File -Append -FilePath $env:GITHUB_ENV
28+
shell: powershell
29+
30+
- name: Build and Publish
31+
run: |
32+
cd ./src/
33+
dotnet restore Aptabase.Maui.csproj
34+
dotnet pack Aptabase.Maui.csproj -c Release -o artifacts -p:PackageVersion=${{ env.PackageVersion }}
35+
36+
- name: Push
37+
run: dotnet nuget push ./src/artifacts/Aptabase.Maui.${{ env.PackageVersion }}.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json

src/Aptabase.Maui.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<PackageId>Aptabase.Maui</PackageId>
5-
<Version>0.0.8</Version>
5+
<Version>0.0.9</Version>
66
<AssemblyVersion>$(Version)</AssemblyVersion>
77
<FileVersion>$(Version)</FileVersion>
88
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
99
<Description>Maui SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps</Description>
1010
<Authors>Aptabase Team</Authors>
11-
<Company>Sumbit Labs Ltd.</Company>
11+
<Company>Aptabase</Company>
1212
<PackageProjectUrl>https://aptabase.com</PackageProjectUrl>
1313
<PackageReadmeFile>README.md</PackageReadmeFile>
1414
<PackageIcon>logo.png</PackageIcon>

0 commit comments

Comments
 (0)