-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (39 loc) · 1.23 KB
/
publish.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
name: NuGet Publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Submodules
shell: bash
run: |
git submodule update --init
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Build
run: dotnet build --configuration Release
- name: Run Tests
run: dotnet test
- name: Package Projects
shell: bash
run: |
dotnet pack -c Release --include-symbols SharpText.Core/SharpText.Core.csproj -o .
dotnet pack -c Release --include-symbols SharpText.Veldrid/SharpText.Veldrid.csproj -o .
- name: Publish Projects
shell: bash
run: |
dotnet nuget push SharpText.Core.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
dotnet nuget push SharpText.Veldrid.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
- name: Tag Repo
shell: bash
run: |
version=v$(grep -o '<Version>[^<]*' Directory.Build.props | sed 's/<Version>//')
echo 'Detected version is $version'
git tag $version
git push origin $version