Skip to content
This repository has been archived by the owner on May 19, 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 318f490 commit 9a53392
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 17 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@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: dotnet nuget push "FileMagic.Bin/*.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 ..
1 change: 0 additions & 1 deletion FileMagic.Console/FileMagic.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<OutputPath>../FileMagic.Console.Bin/</OutputPath>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 0 additions & 2 deletions FileMagic.Native/FileMagic.Native.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>../FileMagic.Bin</PackageOutputPath>
<OutputPath>../FileMagic.Bin/</OutputPath>
<Nullable>disable</Nullable>
<PackageId>FileMagic.Native</PackageId>
<Authors>Aptivi</Authors>
Expand Down
2 changes: 0 additions & 2 deletions FileMagic/FileMagic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageOutputPath>../FileMagic.Bin</PackageOutputPath>
<PackageId>FileMagicManaged</PackageId>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand All @@ -23,7 +22,6 @@
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<LangVersion>latest</LangVersion>
<OutputPath>../FileMagic.Bin/</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\aptivi_snk.snk</AssemblyOriginatorKeyFile>
Expand Down
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 9a53392

Please sign in to comment.