Skip to content

Commit 537033c

Browse files
committed
Added deployment of packages
1 parent e3ad267 commit 537033c

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/scripts/deploy-package.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
cd source/$1
3+
4+
dotnet pack -c release /p:PackageVersion=$GITHUB_REF_NAME --no-restore -o .
5+
6+
dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json

.github/scripts/deploy-packages.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
chmod +x ./.github/scripts/deploy-package.sh
3+
4+
echo Started deploy.
5+
6+
for dir in source/*/
7+
do
8+
dir=${dir%*/}
9+
10+
if [[ ${dir##*/} == 'Internals' ]]
11+
then
12+
continue
13+
fi
14+
15+
echo Deploying package: ${dir##*/}
16+
17+
exec ./.github/scripts/deploy-package.sh ${dir##*/} &
18+
wait
19+
done
20+
21+
echo Finished deploy.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deployment of packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup .NET SDK
17+
uses: actions/setup-dotnet@v4
18+
19+
- name: Build
20+
run: dotnet build -c Release
21+
22+
- name: Publish NuGet packacges
23+
env:
24+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
25+
run: chmod +x ./.github/scripts/deploy-packages.sh && ./.github/scripts/deploy-packages.sh
26+
shell: bash

0 commit comments

Comments
 (0)