-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (62 loc) · 1.96 KB
/
release.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release Package
# This action will start when a correctly formatted tag is pushed (e.g. 0.1.0)
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
# build:
# runs-on: windows-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Setup .NET v6
# uses: actions/setup-dotnet@v2
# with:
# dotnet-version: 6.0.x
# - name: Setup .NET v8
# uses: actions/setup-dotnet@v2
# with:
# dotnet-version: 8.0.x
# - name: Build project
# run: dotnet build src\AccessibleMediaPicker\HCS.Media.AccessibleMediaPicker.csproj --configuration Release
pack:
runs-on: windows-latest
#needs: build
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET v6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup .NET v8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Show VERSION
run: echo "${VERSION}"
- name: Pack
run: dotnet pack src\AccessibleMediaPicker\HCS.Media.AccessibleMediaPicker.csproj --output ./artifacts --configuration Release -p:Version=$VERSION
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./artifacts
publish:
runs-on: ubuntu-latest
needs: pack
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup .NET v8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- uses: actions/download-artifact@v4
with:
name: artifacts
path: ./artifacts
- name: Push to NuGet
run: dotnet nuget push ./artifacts/**.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json