Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

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 d0442de commit df2277d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +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 "Figletize/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_APIKEY }} --source "nuget.org"
dotnet nuget push "Figletize.Generator/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 df2277d

Please sign in to comment.