Skip to content

Commit

Permalink
upd - Added the push scripts and used them
Browse files Browse the repository at this point in the history
  • Loading branch information
AptiviCEO committed Apr 22, 2024
1 parent e46466a commit 9c79939
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: make
- name: Package Publication
run: dotnet nuget push "VisualCard/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_APIKEY }} --source "nuget.org"

- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Solution Compilation
run: make
- name: Package Publication
run: |
chmod +x tools/*.sh
cd tools ; NUGET_APIKEY=${{ secrets.NUGET_APIKEY }} ./push.sh ; cd ..
13 changes: 13 additions & 0 deletions tools/push.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
set apikey=%1

REM This script pushes. Use when you have VS installed.
echo Pushing...
cmd /C "forfiles /s /m *.nupkg /p ..\ /C "cmd /c dotnet nuget push @path --api-key %apikey% --source "nuget.org"""
if %errorlevel% == 0 goto :success
echo There was an error trying to push (%errorlevel%).
goto :finished

:success
echo Push successful.
:finished
25 changes: 25 additions & 0 deletions tools/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# This script pushes. Use when you have dotnet installed.
releaseconf=$1
if [ -z $releaseconf ]; then
releaseconf=Release
fi

# Check for dependencies
dotnetpath=`which dotnet`
if [ ! $? == 0 ]; then
echo dotnet is not found.
exit 1
fi

# Push packages
echo Pushing packages...
find .. -type f -path "*/bin/$releaseconf/*.nupkg" -exec dotnet nuget push {} --api-key $NUGET_APIKEY --source "nuget.org" \;
if [ ! $? == 0 ]; then
echo Push failed.
exit 1
fi

# Inform success
echo Push successful.
exit 0

0 comments on commit 9c79939

Please sign in to comment.