-
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 2.01 KB
/
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
name: Publish NuGet
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Get Version via powershell
id: get_version
run: |
$version = [System.Version]::Parse((Get-Content NetPalette/NetPalette.csproj | Select-String -Pattern "<Version>(.*)</Version>").Matches.Groups[1].Value)
$env:CURRENT_VERSION = $version.ToString()
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
run: |
dotnet workload install maui --ignore-failed-sources
cd NetPalette
dotnet restore
dotnet build --no-restore --configuration Release
- name: Publish NuGet
# You may pin to the exact commit or the version.
# uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc
uses: alirezanet/[email protected]
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: NetPalette/NetPalette.csproj
# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
- name: Push Nupkg to GitHub Packages
# You may pin to the exact commit or the version.
# uses: tanaka-takayoshi/nuget-publish-to-github-packages-action@462b6006e5c90f732d030b0ace2c3e7ee9d550bc
uses: tanaka-takayoshi/[email protected]
with:
# Path of NuPkg
nupkg-path: "**/*.nupkg"
# package repository owner
repo-owner: nor0x
# user account
gh-user: nor0x
# access token
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get_version.outputs.CURRENT_VERSION }}
name: Release ${{ steps.get_version.outputs.CURRENT_VERSION }}
body: ${{ steps.tag_version.outputs.changelog }}