-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.46 KB
/
build-test-pack-push.yml
File metadata and controls
55 lines (50 loc) · 1.46 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
name: Build Test Pack Push
on:
workflow_call:
inputs:
wfl_call:
description: 'is called from workflow'
type: boolean
required: false
default: true
release_notes:
description: 'Release notes'
type: string
required: true
version:
description: 'Release version'
type: string
required: true
workflow_dispatch:
pull_request:
branches:
- main
env:
PROJECT_PATH: ./src/TgBotPlay.WebAPI
UNITTEST_PATH:
CONFIGURATION: Release
RELEASE_NOTES: ${{ inputs.release_notes }}
VERSION: ${{ inputs.version || '0.0.1'}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore $PROJECT_PATH
- name: Build
run: dotnet build $PROJECT_PATH --no-restore --configuration $CONFIGURATION -p:Version=$VERSION "-p:ReleaseNotes=\"$RELEASE_NOTES\""
# - name: Test
# run: dotnet test $UNITTEST_PATH --verbosity normal --configuration $CONFIGURATION
- name: Push Package to NuGet.org
if: ${{ inputs.wfl_call }}
run: dotnet nuget push **\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
- name: Tag and push
if: ${{ inputs.wfl_call }}
run: |
git tag v$VERSION
git push --tags