Skip to content

Commit

Permalink
Merge pull request #60 from tonybaloney/use_nuget_packages
Browse files Browse the repository at this point in the history
Use the nuget packages for the demo solution
  • Loading branch information
tonybaloney authored Jul 26, 2024
2 parents f434169 + cf91169 commit 189c46f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 29 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/dotnet-publish-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
DOTNET_VERSION: 8.0.x
NUGET_VERSION: 1.0.1
NUGET_VERSION: 1.0.2

jobs:
publish-github-packages:
Expand Down Expand Up @@ -39,13 +39,15 @@ jobs:
- name: Publish NuGet package CSnakes.Runtime
run: dotnet pack src/CSnakes.Runtime --no-build -c Release -o ./nuget -p:PackageVersion='${{ env.NUGET_VERSION }}' --version-suffix 'alpha${{ github.run_number }}'

- name: Publish to GitHub packages
run: dotnet nuget push ./nuget/*.nupkg --source "github"
env:
NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}

- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget

- name: Publish to GitHub packages
run: dotnet nuget push ./nuget/*.nupkg --source "github"
env:
NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}


8 changes: 4 additions & 4 deletions .github/workflows/dotnet-publish-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
DOTNET_VERSION: 8.0.x
NUGET_VERSION: 1.0.1
NUGET_VERSION: 1.0.2

jobs:
publish-github-packages:
Expand Down Expand Up @@ -39,11 +39,11 @@ jobs:
- name: Publish NuGet package CSnakes.Runtime
run: dotnet pack src/CSnakes.Runtime --no-build -c Release -o ./nuget -p:PackageVersion='${{ env.NUGET_VERSION }}' --version-suffix 'beta${{ github.run_number }}'

- name: Publish to GitHub packages
run: dotnet nuget push ./nuget/*.nupkg --source "nuget" --api-key ${{ secrets.NUGET_API_KEY }}

- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget

- name: Publish to GitHub packages
run: dotnet nuget push ./nuget/*.nupkg --source "nuget" --api-key ${{ secrets.NUGET_API_KEY }}
34 changes: 17 additions & 17 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="github" value="https://nuget.pkg.github.com/tonybaloney/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="github">
<package pattern="CSnakes*" />
</packageSource>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="github" value="https://nuget.pkg.github.com/tonybaloney/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="github">
<package pattern="CSnakes*" />
</packageSource>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="python" Version="3.12.4" />
<PackageReference Include="CSnakes" Version="1.0.1" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions samples/QuickConsoleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Python.Generated;
using PythonEnvironments;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;

// See https://aka.ms/new-console-template for more information
Expand Down
7 changes: 6 additions & 1 deletion samples/QuickConsoleTest/QuickConsoleTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

<PropertyGroup>
<ProductName>Example Python Embedded Console App</ProductName>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSnakes.Runtime" Version="1.0.1" />
<PackageReference Include="python" Version="3.12.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ExamplePythonDependency\ExamplePythonDependency.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/CSnakes/CSnakes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="$(PKGSuperpower)\lib\netstandard2.0\Superpower.dll" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<PropertyGroup>
Expand Down

0 comments on commit 189c46f

Please sign in to comment.