-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.25 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
54
55
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ./src/sika/
- name: Build
run: dotnet build --no-restore
working-directory: ./src/sika/
- name: Publish to NuGet
uses: brandedoutcast/publish-nuget@v2.5.2
with:
PROJECT_FILE_PATH: "src/sika/sika.csproj"
VERSION_REGEX: '<AssemblyVersion>(.*)<\/AssemblyVersion>'
NUGET_KEY: ${{secrets.NUGET_KEY}}
if: github.event_name != 'pull_request'
- name: Retrieve version
id: proj_version
uses: KageKirin/get-csproj-version@v0
with:
file: src/sika/sika.csproj
xpath: '//PropertyGroup/AssemblyVersion'
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.proj_version.version }}
run: |
gh release create "v$VERSION" \
--repo="$GITHUB_REPOSITORY" \
--generate-notes