-
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (65 loc) · 2.68 KB
/
Copy pathdotnet.yml
File metadata and controls
69 lines (65 loc) · 2.68 KB
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
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 TouchTracking.MAUI/TouchTracking.MAUI.csproj | Select-String -Pattern "<Version>(.*)</Version>").Matches.Groups[1].Value)
$env:CURRENT_VERSION = $version.ToString()
echo "::set-output name=CURRENT_VERSION::$env:CURRENT_VERSION"
- name: Log Current Version
run: |
echo "Current Version: ${{ steps.get_version.outputs.CURRENT_VERSION }}"
- 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 TouchTracking.MAUI
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/publish-nuget@v3.0.4
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: TouchTracking.MAUI/TouchTracking.MAUI.csproj
# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
TAG_COMMIT: false
- 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/nuget-publish-to-github-packages-action@v2.1
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 GitHub Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
custom_tag: ${{ steps.get_version.outputs.CURRENT_VERSION }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.get_version.outputs.CURRENT_VERSION }}
body: |
# Release ${{ steps.get_version.outputs.CURRENT_VERSION }}
This release is based on the commit: ${{ github.event.repository.full_name }}@${{ github.sha }}.