This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.66 KB
/
dotnet_nuget_shared.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET NuGet Shared Release
on:
release:
types: created
workflow_dispatch:
jobs:
build:
environment: NuGet
runs-on: ubuntu-latest
env:
Solution_Name: Scintilla.NET.EtoForms.Shared\Scintilla.NET.EtoForms.Shared.sln
App_Project_Path: Scintilla.NET.EtoForms.Shared\Scintilla.NET.EtoForms.Shared.csproj
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
NUGETAPI: ${{ secrets.NUGETAPI }}
GH_PACKAGES_APIKEY: ${{ secrets.GH_PACKAGES_APIKEY }}
PACKAGESAPI: ${{ secrets.PACKAGESAPI }}
NUGETCONFIG: ${{ secrets.NUGETCONFIG }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore $Solution_Name
- name: Build
run: dotnet build --no-restore --configuration Release $App_Project_Path
- name: Decode nuget.config
if: ${{ github.event_name != 'pull_request' }}
run: |
currentDirectory=`pwd`
nuget_config_bytes=`echo $NUGETCONFIG | base64 --decode`
nugetConfigFile="$currentDirectory/nuget.config"
echo "$nuget_config_bytes" > $nugetConfigFile
- name: NuGet push
if: ${{ github.event_name != 'pull_request' }}
run: |
find . -name '*Scintilla.NET.Eto*.nupkg' | while read line; do
nuget push $line $NUGET_APIKEY -Source $NUGETAPI -SkipDuplicate
nuget push $line $GH_PACKAGES_APIKEY -Source $PACKAGESAPI -SkipDuplicate
done