-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.39 KB
/
publish-package-pipeline.yml
File metadata and controls
57 lines (45 loc) · 1.39 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
name: workflow - publish package
on:
push:
branches:
- master
- development
paths:
- 'Artifacts/Comanda.Internal.Contracts/**'
pull_request:
branches:
- master
- development
paths:
- 'Artifacts/Comanda.Internal.Contracts/**'
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Artifacts/Comanda.Internal.Contracts
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: restore dependencies
run: dotnet restore
- name: build
run: dotnet build --configuration Release --no-restore
- name: set version and pack
id: pack
run: |
BASE_VERSION="1.0"
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}"
else
VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}"
fi
echo "use version: $VERSION"
dotnet pack -c Release -p:PackageVersion=$VERSION -o ./output --no-build
echo "package_version=$VERSION" >> $GITHUB_OUTPUT
- name: push package to nuget
run: dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate