-
Notifications
You must be signed in to change notification settings - Fork 39
29 lines (26 loc) · 1.15 KB
/
main_cd.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
name: Create a release on NuGet
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-pre[0-9]+"
jobs:
release-nuget:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Get version information from tag
id: get_version
run: |
$version="${{github.ref_name}}".TrimStart("v")
"version-without-v=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: Pack
run: dotnet pack MAUI.FreakyControls\MAUI.FreakyControls\Maui.FreakyControls.csproj -c Release -p:PackageVersion=${{ steps.get_version.outputs.version-without-v }}
- name: Push
run: dotnet nuget push MAUI.FreakyControls\MAUI.FreakyControls\bin\Release\FreakyControls.${{ steps.get_version.outputs.version-without-v }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}