Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/actions/dotnet/action.yml

This file was deleted.

11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:

env:
DOTNET_NOLOGO: true
PackOnBuild: true
GeneratePackageOnBuild: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down Expand Up @@ -76,6 +74,15 @@ jobs:
dotnet tool update -g dotnet-retest
dotnet retest -- --no-build

- name: 🙏 publish
shell: pwsh
run: |
$rids = dotnet msbuild src/runfile/runfile.csproj -getproperty:RuntimeIdentifiers
$rids | %{ $_.Split(';') } | %{ $_.Trim() } | ? { $_ } | %{ dotnet publish -r $_ }

- name: 📦 pack
run: dotnet pack --no-build -m:1 -bl:pack.binlog

- name: 🐛 logs
uses: actions/upload-artifact@v4
if: runner.debug && always()
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
env:
DOTNET_NOLOGO: true
Configuration: Release
PackOnBuild: true
GeneratePackageOnBuild: true
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MSBUILDTERMINALLOGGER: auto
Expand All @@ -38,6 +36,15 @@ jobs:
dotnet tool update -g dotnet-retest
dotnet retest -- --no-build

- name: 🙏 publish
shell: pwsh
run: |
$rids = dotnet msbuild src/runfile/runfile.csproj -getproperty:RuntimeIdentifiers
$rids | %{ $_.Split(';') } | %{ $_.Trim() } | ? { $_ } | %{ dotnet publish -r $_ }

- name: 📦 pack
run: dotnet pack --no-build -m:1 -bl:pack.binlog

- name: 🐛 logs
uses: actions/upload-artifact@v4
if: runner.debug && always()
Expand Down
4 changes: 1 addition & 3 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
weak
[file ".github/actions/dotnet/action.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
weak
skip
[file ".github/dependabot.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
sha = e733294084fb3e75d517a2e961e87df8faae7dc6
Expand Down
54 changes: 27 additions & 27 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
# Changelog

## [v0.5.1](https://github.com/devlooped/runcs/tree/v0.5.1) (2025-09-25)
## [v0.5.1](https://github.com/devlooped/runfile/tree/v0.5.1) (2025-09-25)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.5.0...v0.5.1)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.5.0...v0.5.1)

## [v0.5.0](https://github.com/devlooped/runcs/tree/v0.5.0) (2025-09-25)
## [v0.5.0](https://github.com/devlooped/runfile/tree/v0.5.0) (2025-09-25)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.4.0...v0.5.0)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.4.0...v0.5.0)

:sparkles: Implemented enhancements:

- Add support for creating aliases for refs [\#18](https://github.com/devlooped/runcs/pull/18) (@kzu)
- Add support for creating aliases for refs [\#18](https://github.com/devlooped/runfile/pull/18) (@kzu)

## [v0.4.0](https://github.com/devlooped/runcs/tree/v0.4.0) (2025-09-24)
## [v0.4.0](https://github.com/devlooped/runfile/tree/v0.4.0) (2025-09-24)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.3.1...v0.4.0)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.3.1...v0.4.0)

:sparkles: Implemented enhancements:

- Update to latest .NET 10 which receives the file without 'run' [\#17](https://github.com/devlooped/runcs/pull/17) (@kzu)
- Default to non-AOT for runcs to broaden run-ability [\#15](https://github.com/devlooped/runcs/pull/15) (@kzu)
- Update to latest .NET 10 which receives the file without 'run' [\#17](https://github.com/devlooped/runfile/pull/17) (@kzu)
- Default to non-AOT for runfile to broaden run-ability [\#15](https://github.com/devlooped/runfile/pull/15) (@kzu)

:hammer: Other:

- Azure DevOps projects and repos with spaces not supported [\#12](https://github.com/devlooped/runcs/issues/12)
- Azure DevOps projects and repos with spaces not supported [\#12](https://github.com/devlooped/runfile/issues/12)

:twisted_rightwards_arrows: Merged:

- Update to latest SLNX format [\#14](https://github.com/devlooped/runcs/pull/14) (@kzu)
- Add support for Azure DevOps projects and repos with spaces [\#13](https://github.com/devlooped/runcs/pull/13) (@alexwiese)
- Update to latest SLNX format [\#14](https://github.com/devlooped/runfile/pull/14) (@kzu)
- Add support for Azure DevOps projects and repos with spaces [\#13](https://github.com/devlooped/runfile/pull/13) (@alexwiese)

## [v0.3.1](https://github.com/devlooped/runcs/tree/v0.3.1) (2025-08-30)
## [v0.3.1](https://github.com/devlooped/runfile/tree/v0.3.1) (2025-08-30)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.3.0...v0.3.1)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.3.0...v0.3.1)

## [v0.3.0](https://github.com/devlooped/runcs/tree/v0.3.0) (2025-08-30)
## [v0.3.0](https://github.com/devlooped/runfile/tree/v0.3.0) (2025-08-30)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.2.0...v0.3.0)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.2.0...v0.3.0)

:sparkles: Implemented enhancements:

- Unify implementation across gist/runcs [\#7](https://github.com/devlooped/runcs/pull/7) (@kzu)
- Add support for downloading and running Azure DevOps too [\#6](https://github.com/devlooped/runcs/pull/6) (@kzu)
- Unify implementation across gist/runfile [\#7](https://github.com/devlooped/runfile/pull/7) (@kzu)
- Add support for downloading and running Azure DevOps too [\#6](https://github.com/devlooped/runfile/pull/6) (@kzu)

## [v0.2.0](https://github.com/devlooped/runcs/tree/v0.2.0) (2025-08-29)
## [v0.2.0](https://github.com/devlooped/runfile/tree/v0.2.0) (2025-08-29)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.1.2...v0.2.0)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.1.2...v0.2.0)

## [v0.1.2](https://github.com/devlooped/runcs/tree/v0.1.2) (2025-08-28)
## [v0.1.2](https://github.com/devlooped/runfile/tree/v0.1.2) (2025-08-28)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.1.1...v0.1.2)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.1.1...v0.1.2)

## [v0.1.1](https://github.com/devlooped/runcs/tree/v0.1.1) (2025-08-28)
## [v0.1.1](https://github.com/devlooped/runfile/tree/v0.1.1) (2025-08-28)

[Full Changelog](https://github.com/devlooped/runcs/compare/v0.1.0...v0.1.1)
[Full Changelog](https://github.com/devlooped/runfile/compare/v0.1.0...v0.1.1)

:sparkles: Implemented enhancements:

- Fail if explicit gist file path not found [\#3](https://github.com/devlooped/runcs/pull/3) (@kzu)
- Fail if explicit gist file path not found [\#3](https://github.com/devlooped/runfile/pull/3) (@kzu)

## [v0.1.0](https://github.com/devlooped/runcs/tree/v0.1.0) (2025-08-28)
## [v0.1.0](https://github.com/devlooped/runfile/tree/v0.1.0) (2025-08-28)

[Full Changelog](https://github.com/devlooped/runcs/compare/ce016575c85c447e1ebc5d2fa109908c92d89f5d...v0.1.0)
[Full Changelog](https://github.com/devlooped/runfile/compare/ce016575c85c447e1ebc5d2fa109908c92d89f5d...v0.1.0)



Expand Down
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
![Icon](https://raw.githubusercontent.com/devlooped/runcs/main/assets/img/icon-32.png) dnx runcs
![Icon](https://raw.githubusercontent.com/devlooped/runfile/main/assets/img/icon-32.png) dnx runfile
============

[![Version](https://img.shields.io/nuget/vpre/runcs.svg?color=royalblue)](https://www.nuget.org/packages/runcs)
[![Downloads](https://img.shields.io/nuget/dt/runcs.svg?color=green)](https://www.nuget.org/packages/runcs)
[![License](https://img.shields.io/github/license/devlooped/runcs.svg?color=blue)](https://github.com/devlooped/runcs/blob/main/license.txt)
[![Build](https://github.com/devlooped/runcs/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/devlooped/runcs/actions/workflows/build.yml)
[![Version](https://img.shields.io/nuget/vpre/runfile.svg?color=royalblue)](https://www.nuget.org/packages/runfile)
[![Downloads](https://img.shields.io/nuget/dt/runfile.svg?color=green)](https://www.nuget.org/packages/runfile)
[![License](https://img.shields.io/github/license/devlooped/runfile.svg?color=blue)](https://github.com/devlooped/runfile/blob/main/license.txt)
[![Build](https://github.com/devlooped/runfile/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/devlooped/runfile/actions/workflows/build.yml)

## dnx runcs
<!-- #runcs -->
## dnx runfile
<!-- #runfile -->
Run C# code programs from git repos on GitHub, GitLab and Azure DevOps.

```
Usage:
[dnx] runcs [--aot] [--alias ALIAS] <repoRef> [<appArgs>...]
[dnx] runfile [--aot] [--alias ALIAS] <repoRef> [<appArgs>...]

Arguments:
<REPO_REF> Reference to remote file to run, with format [host/]owner/repo[@ref][:path]
Expand All @@ -37,10 +37,10 @@ Options:
Example:

```
dnx runcs kzu/runcs@v1:run.cs dotnet rocks
dnx runfile kzu/runfile@v1:run.cs dotnet rocks
```

View [source](https://github.com/kzu/runcs/blob/v1/run.cs):
View [source](https://github.com/kzu/runfile/blob/v1/run.cs):

```csharp
#:package Spectre.Console@*
Expand All @@ -57,7 +57,7 @@ AnsiConsole.MarkupLine($"Hello world from [green]dnx[/] [yellow]gist[/] :rocket:
When running different files from the same repo+ref, the download will be performed only once.
The last download etag is used to avoid downloading on each run.

<!-- #runcs -->
<!-- #runfile -->

## dnx gist

Expand Down
2 changes: 1 addition & 1 deletion runcs.slnx → runfile.slnx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Solution>
<Project Path="src/Core/Core.csproj" />
<Project Path="src/gist/gist.csproj" />
<Project Path="src/runcs/runcs.csproj" />
<Project Path="src/runfile/runfile.csproj" />
<Project Path="src/Tests/Tests.csproj" />
</Solution>
6 changes: 3 additions & 3 deletions src/Core/RemoteRefExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ public static class RemoteRefExtensions
public string EnsureTempPath() => Directory.CreateUserDirectory(location.TempPath);
}

/// <summary>Obtains the temporary directory root, e.g., <c>/tmp/dotnet/runcs/</c>.</summary>
/// <summary>Obtains the temporary directory root, e.g., <c>/tmp/dotnet/runfile/</c>.</summary>
static string GetTempRoot()
{
// We want a location where permissions are expected to be restricted to the current user.
string directory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? Path.GetTempPath()
: Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

return Directory.CreateUserDirectory(Path.Join(directory, "dotnet", "runcs"));
return Directory.CreateUserDirectory(Path.Join(directory, "dotnet", "runfile"));
}

/// <summary>Obtains a specific temporary path in a subdirectory of the temp root, e.g., <c>/tmp/dotnet/runcs/{name}</c>.</summary>
/// <summary>Obtains a specific temporary path in a subdirectory of the temp root, e.g., <c>/tmp/dotnet/runfile/{name}</c>.</summary>
public static string GetTempSubpath(params string[] name) => Directory.CreateUserDirectory(Path.Join([GetTempRoot(), .. name]));
}
2 changes: 1 addition & 1 deletion src/Directory.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<LangVersion>Preview</LangVersion>
<RestoreSources>https://api.nuget.org/v3/index.json;https://pkg.kzu.app/index.json</RestoreSources>
<ProjectName>runcs</ProjectName>
<ProjectName>runfile</ProjectName>
</PropertyGroup>
<ItemGroup>
<ProjectProperty Include="ProjectName" />
Expand Down
30 changes: 15 additions & 15 deletions src/Tests/DownloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ public class DownloadTests
{
[LocalTheory]
// Requires being authenticated with private kzu's GH repo
[InlineData("github.com/kzu/runcs")]
[InlineData("github.com/kzu/runcs@v0.1.0")]
[InlineData("github.com/kzu/runcs@dev")]
[InlineData("github.com/kzu/runcs@211de7614553152d848ef53dd9587d1a52c76582")]
[InlineData("github.com/kzu/runcs@211de7614")]
[InlineData("github.com/kzu/runcs@211de761455")]
[InlineData("github.com/kzu/runfile")]
[InlineData("github.com/kzu/runfile@v0.1.0")]
[InlineData("github.com/kzu/runfile@dev")]
[InlineData("github.com/kzu/runfile@211de7614553152d848ef53dd9587d1a52c76582")]
[InlineData("github.com/kzu/runfile@211de7614")]
[InlineData("github.com/kzu/runfile@211de761455")]
// Requires running the CLI app once against this private repo and saving a PAT
[InlineData("gitlab.com/kzu/runcs")]
[InlineData("gitlab.com/kzu/runcs@v0.1.0")]
[InlineData("gitlab.com/kzu/runcs@dev")]
[InlineData("gitlab.com/kzu/runcs@533ecac61d4cf62dac0c72567e73753acd235ac2")]
[InlineData("gitlab.com/kzu/runcs@533ecac61")]
[InlineData("gitlab.com/kzu/runcs@533ecac61d4")]
[InlineData("gitlab.com/kzu/runfile")]
[InlineData("gitlab.com/kzu/runfile@v0.1.0")]
[InlineData("gitlab.com/kzu/runfile@dev")]
[InlineData("gitlab.com/kzu/runfile@533ecac61d4cf62dac0c72567e73753acd235ac2")]
[InlineData("gitlab.com/kzu/runfile@533ecac61")]
[InlineData("gitlab.com/kzu/runfile@533ecac61d4")]
// Also private auth
//[InlineData("bitbucket.org/kzu/runcs")]
//[InlineData("bitbucket.org/kzu/runcs@v0.1.0")]
//[InlineData("bitbucket.org/kzu/runcs@dev")]
//[InlineData("bitbucket.org/kzu/runfile")]
//[InlineData("bitbucket.org/kzu/runfile@v0.1.0")]
//[InlineData("bitbucket.org/kzu/runfile@dev")]
public async Task DownloadPrivateUnchanged(string value)
{
Assert.True(RemoteRef.TryParse(value, out var location));
Expand Down
12 changes: 3 additions & 9 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" PrivateAssets="all" />
<PackageReference Include="git-credential-manager" Version="2.6.1" IncludeAssets="tools" GeneratePathProperty="true" />
<PackageReference Include="Avalonia" Version="11.3.4" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.4" />
Expand All @@ -41,7 +35,7 @@

<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
<ProjectReference Include="..\runcs\runcs.csproj" />
<ProjectReference Include="..\runfile\runfile.csproj" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/gist/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

var config = Config.Build(Config.GlobalLocation);
if (args.Length > 0 && config.GetString("runcs", args[0]) is string aliased)
if (args.Length > 0 && config.GetString("runfile", args[0]) is string aliased)
args = [aliased, .. args[1..]];

// Set alias and remove from args if present
Expand Down Expand Up @@ -56,7 +56,7 @@ Can be an alias previously set with --alias.
}

if (alias != null)
config = config.SetString("runcs", alias, location.ToString());
config = config.SetString("runfile", alias, location.ToString());

// Create the dispatcher on the main thread. This is required
// for some platform UI services such as macOS that mandates
Expand Down
13 changes: 12 additions & 1 deletion src/gist/gist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@
<RootNamespace>Devlooped</RootNamespace>

<PackageId>gist</PackageId>
<Description>Run C# code gists directly using: dnx gist owner/gist[:path]</Description>

<ToolCommandName>gist</ToolCommandName>
<PackAsTool>true</PackAsTool>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageTags>dotnet dotnet-tool</PackageTags>

<Description>Run C# code gists directly using: dnx gist owner/gist[:path]</Description>
<RuntimeIdentifier Condition="$(BuildingInsideVisualStudio) == 'true'">win-x64</RuntimeIdentifier>
<RuntimeIdentifiers>
linux-x64;
linux-arm64;
osx-arm64;
osx-x64;
win-x64;
win-arm64
</RuntimeIdentifiers>
<PublishSelfContained>false</PublishSelfContained>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading